loop the video if set so

This commit is contained in:
tibbi 2016-12-28 20:37:10 +01:00
parent 1bbca50bac
commit 085c62b10b

View file

@ -276,10 +276,14 @@ class VideoFragment : ViewPagerFragment(), View.OnClickListener, SurfaceHolder.C
} }
override fun onCompletion(mp: MediaPlayer) { override fun onCompletion(mp: MediaPlayer) {
if (Config.newInstance(context).loopVideos) {
playVideo()
} else {
mSeekBar!!.progress = mSeekBar!!.max mSeekBar!!.progress = mSeekBar!!.max
mCurrTimeView!!.text = getTimeString(mDuration) mCurrTimeView!!.text = getTimeString(mDuration)
pauseVideo() pauseVideo()
} }
}
override fun onVideoSizeChanged(mp: MediaPlayer, width: Int, height: Int) { override fun onVideoSizeChanged(mp: MediaPlayer, width: Int, height: Int) {
setVideoSize() setVideoSize()