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
1 changed files with 2 additions and 1 deletions

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()