check null exoplayer at skipping
This commit is contained in:
parent
dbdf5b5acd
commit
4c2c330cbc
2 changed files with 8 additions and 0 deletions
|
@ -503,6 +503,10 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun doSkip(forward: Boolean) {
|
private fun doSkip(forward: Boolean) {
|
||||||
|
if (mExoPlayer == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
val curr = mExoPlayer!!.currentPosition
|
val curr = mExoPlayer!!.currentPosition
|
||||||
val newProgress = if (forward) curr + FAST_FORWARD_VIDEO_MS else curr - FAST_FORWARD_VIDEO_MS
|
val newProgress = if (forward) curr + FAST_FORWARD_VIDEO_MS else curr - FAST_FORWARD_VIDEO_MS
|
||||||
val roundProgress = Math.round(newProgress / 1000f)
|
val roundProgress = Math.round(newProgress / 1000f)
|
||||||
|
|
|
@ -546,6 +546,10 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun doSkip(forward: Boolean) {
|
private fun doSkip(forward: Boolean) {
|
||||||
|
if (mExoPlayer == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
val curr = mExoPlayer!!.currentPosition
|
val curr = mExoPlayer!!.currentPosition
|
||||||
val newProgress = if (forward) curr + FAST_FORWARD_VIDEO_MS else curr - FAST_FORWARD_VIDEO_MS
|
val newProgress = if (forward) curr + FAST_FORWARD_VIDEO_MS else curr - FAST_FORWARD_VIDEO_MS
|
||||||
val roundProgress = Math.round(newProgress / 1000f)
|
val roundProgress = Math.round(newProgress / 1000f)
|
||||||
|
|
Loading…
Reference in a new issue