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

PlayerController: Prevent IllegalStateException

parent f7d97167
No related branches found
No related tags found
No related merge requests found
......@@ -115,9 +115,9 @@ class PlayerController(val context: Context) : IVLCVout.Callback, MediaPlayer.Ev
fun isPlaying() = playbackState == PlaybackStateCompat.STATE_PLAYING
fun isVideoPlaying() = mediaplayer.vlcVout.areViewsAttached()
fun isVideoPlaying() = !mediaplayer.isReleased && mediaplayer.vlcVout.areViewsAttached()
fun canSwitchToVideo() = mediaplayer.hasMedia() && mediaplayer.videoTracksCount > 0
fun canSwitchToVideo() = getVideoTracksCount() > 0
fun getVideoTracksCount() = if (!mediaplayer.isReleased && mediaplayer.hasMedia()) mediaplayer.videoTracksCount else 0
......
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