mengzhidaren / Vlc-sdk-lib

vlc-android The latest compilation video playback libraries 最新视频库支持录屏 欢迎star
491 stars 121 forks source link

界面切换时播放卡顿问题 #141

Closed mingxin-yang closed 6 years ago

mingxin-yang commented 6 years ago

我使用的是直播流播放,mSufaceView 是 vlcVideoView

if (mediaPlayer==null){
    ArrayList<String> libOptions = VLCOptions.getLibOptions(this);
    LibVLC libVLC = new LibVLC(this, libOptions);
    media = new Media(libVLC, Uri.parse(mUrl));
    media.setHWDecoderEnabled(false, false);
    media.addOption(":network-caching=100");
    mediaPlayer = new MediaPlayer(media);
    mSurfaceView.setMedia(mediaPlayer);
    mSurfaceView.startPlay();
}else {
    mSurfaceView.start();
}

这个方法在onResume里面会调用。

if (mSurfaceView != null) {
            mSurfaceView.pause();
        }

这个方法在onPause里面调用。 现在的问题是切换到下一个界面再切换回来,播放的画面会卡顿一会。请问如何解决?

mingxin-yang commented 6 years ago

@mengzhidaren

mengzhidaren commented 6 years ago

试着改下我的代码去适配你app的功能吧 我写的主要是点播用 还是测试版的 直播的还没做 一直没时间

mingxin-yang commented 6 years ago

ok