Skip to content
Snippets Groups Projects
Commit 9aecf984 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Player controller: avoid IllegalStateException

parent 5983d0ad
No related branches found
No related tags found
No related merge requests found
......@@ -103,11 +103,11 @@ class PlayerController(val context: Context) : IVLCVout.Callback, MediaPlayer.Ev
}
fun setPosition(position: Float) {
if (seekable) mediaplayer.position = position
if (seekable && mediaplayer.hasMedia() && !mediaplayer.isReleased) mediaplayer.position = position
}
fun setTime(time: Long) {
if (seekable) mediaplayer.time = time
if (seekable && mediaplayer.hasMedia() && !mediaplayer.isReleased) mediaplayer.time = time
}
fun isPlaying() = playbackState == PlaybackStateCompat.STATE_PLAYING
......
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