Commit 01906100 authored by Geoffrey Métais's avatar Geoffrey Métais

PlayerController: Check player is not released

parent 23296033
Pipeline #4383 passed with stage
in 26 minutes and 14 seconds
......@@ -51,7 +51,7 @@ class PlayerController(val context: Context) : IVLCVout.Callback, MediaPlayer.Ev
fun getMedia(): Media? = mediaplayer.media
fun play() {
if (mediaplayer.hasMedia()) mediaplayer.play()
if (mediaplayer.hasMedia() && !mediaplayer.isReleased) mediaplayer.play()
}
fun pause(): Boolean {
......@@ -63,7 +63,7 @@ class PlayerController(val context: Context) : IVLCVout.Callback, MediaPlayer.Ev
}
fun stop() {
if (mediaplayer.hasMedia()) mediaplayer.stop()
if (mediaplayer.hasMedia() && !mediaplayer.isReleased) mediaplayer.stop()
setPlaybackStopped()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment