Skip to content
Snippets Groups Projects
Commit c4e9dd7c authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Fix IllegalStateException

parent 9c3b7d38
No related branches found
No related tags found
1 merge request!1068Beta fixes
Pipeline #126790 passed with stage
in 2 minutes and 33 seconds
...@@ -99,10 +99,12 @@ class PlayerController(val context: Context) : IVLCVout.Callback, MediaPlayer.Ev ...@@ -99,10 +99,12 @@ class PlayerController(val context: Context) : IVLCVout.Callback, MediaPlayer.Ev
@MainThread @MainThread
fun restart() { fun restart() {
val mp = mediaplayer val mp = mediaplayer
val volume = mp.volume val volume:Int? = if (!mp.isReleased) mp.volume else null
mediaplayer = newMediaPlayer() mediaplayer = newMediaPlayer()
if (volume > 100) { volume?.let {
mediaplayer.volume = volume if (it > 100) {
mediaplayer.volume = it
}
} }
release(mp) release(mp)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment