do not continue at setting up the video if theres an error

This commit is contained in:
tibbi 2017-05-28 23:11:28 +02:00
parent e3f0d7ea56
commit 18b714f9c3
1 changed files with 3 additions and 1 deletions

View File

@ -306,8 +306,10 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
return return
initMediaPlayer() initMediaPlayer()
if (mMediaPlayer == null) if (mMediaPlayer == null) {
activity.toast(R.string.unknown_error_occurred) activity.toast(R.string.unknown_error_occurred)
return
}
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