Skip to content

mingxin-yang/VLCView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

VLCView

使用方法

1. 添加libvlc至libs文件夹

2. 在module中的build.grade 添加

implementation(name: 'libvlc-3.0.0-1.9.8', ext: 'aar')

3. 添加view到xml文件:

<VideoViewer
    android:id="@+id/surface"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    />

4. 在Java文件里面创建播放器:

在onResume()里面添加:

VideoViewer mSurfaceView = findViewById(R.id.surface);
mSurfaceView.post(new Runnable() {
	@Override
	public void run() {
		if (!sURL.startsWith("http")) {
			mSurfaceView.createPlayer(sURL, true, 100);
		}else{
			mSurfaceView.createPlayer(sURL, true, 10000);
		}
	}
});

在OnPause()里面添加:

if(mSurfaceView != null){
  mSurfaceView.releasePlayer()
}

OVER!!!!

About

android_vlc播放view

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages