Browse Source

PlayIndex: fix play-as-audio

By getting a media from the medialibrary from the the currentmedia's uri
to ensure that we have the medialibrary metadata for the file, the new
media from the same uri won't have the flags previously set, including
MEDIA_FORCE_AUDIO which start the media as audio.

To fix this, the flags from the previous mediawrapper are applied to the
new one.

Fixed a regression introduced by ea39df7bb7
merge-requests/1594/merge
Duncan McNamara 1 year ago
committed by Nicolas Pomepuy
parent
commit
50402c904b
  1. 1
      application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt

1
application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt

@ -484,6 +484,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
val media = mediaList.getMedia(index) ?: return
val mw = medialibrary.getMedia(media.uri) ?: media
mw.flags = media.flags
val isInCustomPiP: Boolean = service.isInPiPMode.value ?: false
if (mw.type == MediaWrapper.TYPE_VIDEO && !isAppStarted() && !isInCustomPiP) videoBackground = true
val isVideoPlaying = mw.type == MediaWrapper.TYPE_VIDEO && player.isVideoPlaying()

Loading…
Cancel
Save