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

Fix logic fail & no need to unset video track

parent 74e7f6b2
...@@ -43,7 +43,7 @@ class PlayerController : IVLCVout.Callback, MediaPlayer.EventListener { ...@@ -43,7 +43,7 @@ class PlayerController : IVLCVout.Callback, MediaPlayer.EventListener {
} }
fun pause(): Boolean { fun pause(): Boolean {
if (!mediaplayer.hasMedia() && !pausable) return false if (!mediaplayer.hasMedia() || !pausable) return false
mediaplayer.pause() mediaplayer.pause()
return true return true
} }
...@@ -155,7 +155,6 @@ class PlayerController : IVLCVout.Callback, MediaPlayer.EventListener { ...@@ -155,7 +155,6 @@ class PlayerController : IVLCVout.Callback, MediaPlayer.EventListener {
fun release(player: MediaPlayer = mediaplayer) { fun release(player: MediaPlayer = mediaplayer) {
player.setEventListener(null) player.setEventListener(null)
player.setVideoTrackEnabled(false)
if (isVideoPlaying()) player.vlcVout.detachViews() if (isVideoPlaying()) player.vlcVout.detachViews()
launch(playerContext) { player.release() } launch(playerContext) { player.release() }
playbackState = PlaybackStateCompat.STATE_STOPPED playbackState = PlaybackStateCompat.STATE_STOPPED
......
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