add an extra check at initializing video media player at menu visibility change

This commit is contained in:
tibbi 2017-06-24 18:56:38 +02:00
parent 418c313d2d
commit e87cc4a86d

View file

@ -95,8 +95,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
super.setMenuVisibility(menuVisible)
mIsFragmentVisible = menuVisible
if (menuVisible) {
if (mSurfaceView != null)
if (mSurfaceView != null && mSurfaceHolder!!.surface.isValid) {
initMediaPlayer()
}
if (context?.config?.autoplayVideos == true) {
playVideo()