rely on the null check inside initMediaPlayer()
This commit is contained in:
parent
0011f41cdb
commit
fe61fdd66a
1 changed files with 2 additions and 6 deletions
|
@ -289,9 +289,7 @@ class VideoFragment : ViewPagerFragment(), View.OnClickListener, SurfaceHolder.C
|
||||||
if (activity == null)
|
if (activity == null)
|
||||||
return
|
return
|
||||||
|
|
||||||
if (mMediaPlayer == null)
|
|
||||||
initMediaPlayer()
|
initMediaPlayer()
|
||||||
|
|
||||||
val videoProportion = mMediaPlayer!!.videoWidth.toFloat() / mMediaPlayer!!.videoHeight.toFloat()
|
val videoProportion = mMediaPlayer!!.videoWidth.toFloat() / mMediaPlayer!!.videoHeight.toFloat()
|
||||||
val display = activity.windowManager.defaultDisplay
|
val display = activity.windowManager.defaultDisplay
|
||||||
val screenWidth: Int
|
val screenWidth: Int
|
||||||
|
@ -344,9 +342,7 @@ class VideoFragment : ViewPagerFragment(), View.OnClickListener, SurfaceHolder.C
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStartTrackingTouch(seekBar: SeekBar) {
|
override fun onStartTrackingTouch(seekBar: SeekBar) {
|
||||||
if (mMediaPlayer == null)
|
|
||||||
initMediaPlayer()
|
initMediaPlayer()
|
||||||
|
|
||||||
mMediaPlayer!!.pause()
|
mMediaPlayer!!.pause()
|
||||||
mIsDragged = true
|
mIsDragged = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue