add a null check at video fastforwarding

This commit is contained in:
tibbi 2018-02-19 18:11:20 +01:00
parent 0e60aca74c
commit 44895ae365

View file

@ -471,6 +471,10 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
} }
private fun skip(forward: Boolean) { private fun skip(forward: Boolean) {
if (mMediaPlayer == null) {
return
}
val curr = mMediaPlayer!!.currentPosition val curr = mMediaPlayer!!.currentPosition
val twoPercents = mMediaPlayer!!.duration / 50 val twoPercents = mMediaPlayer!!.duration / 50
val newProgress = if (forward) curr + twoPercents else curr - twoPercents val newProgress = if (forward) curr + twoPercents else curr - twoPercents