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) super.setMenuVisibility(menuVisible)
mIsFragmentVisible = menuVisible mIsFragmentVisible = menuVisible
if (menuVisible) { if (menuVisible) {
if (mSurfaceView != null) if (mSurfaceView != null && mSurfaceHolder!!.surface.isValid) {
initMediaPlayer() initMediaPlayer()
}
if (context?.config?.autoplayVideos == true) { if (context?.config?.autoplayVideos == true) {
playVideo() playVideo()