add a null check at setting video size
This commit is contained in:
parent
9e788d9453
commit
8603661873
1 changed files with 4 additions and 0 deletions
|
@ -14,6 +14,7 @@ import android.view.animation.AnimationUtils
|
|||
import android.widget.SeekBar
|
||||
import android.widget.TextView
|
||||
import com.simplemobiletools.commons.extensions.getFormattedDuration
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.commons.extensions.updateTextColors
|
||||
import com.simplemobiletools.gallery.R
|
||||
import com.simplemobiletools.gallery.extensions.config
|
||||
|
@ -304,6 +305,9 @@ class VideoFragment : ViewPagerFragment(), SurfaceHolder.Callback, SeekBar.OnSee
|
|||
return
|
||||
|
||||
initMediaPlayer()
|
||||
if (mMediaPlayer == null)
|
||||
activity.toast(R.string.unknown_error_occurred)
|
||||
|
||||
val videoProportion = mMediaPlayer!!.videoWidth.toFloat() / mMediaPlayer!!.videoHeight.toFloat()
|
||||
val display = activity.windowManager.defaultDisplay
|
||||
val screenWidth: Int
|
||||
|
|
Loading…
Reference in a new issue