[Android] Fix broadcasted metadata and add the chapter
Nicolas Pomepuy
git at videolan.org
Wed Oct 19 08:11:26 UTC 2022
vlc-android | branch: 3.5.x | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Oct 19 08:17:37 2022 +0200| [ad2e0126f6098c9752d20af300d9d3f52d3558c7] | committer: Nicolas Pomepuy
Fix broadcasted metadata and add the chapter
Fixes #2725
(cherry picked from commit 0cbe78a43f5f0a0d7ce0d18d570ad5df8300c05c)
> https://code.videolan.org/videolan/vlc-android/commit/ad2e0126f6098c9752d20af300d9d3f52d3558c7
---
application/vlc-android/src/org/videolan/vlc/PlaybackService.kt | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt b/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
index d10b6b80c..bacbd8e37 100644
--- a/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
+++ b/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
@@ -1250,11 +1250,14 @@ class PlaybackService : MediaBrowserServiceCompat(), LifecycleOwner, CoroutineSc
if (lifecycleScope.isActive) lifecycleScope.launch(Dispatchers.Default) {
sendBroadcast(Intent("com.android.music.metachanged")
.putExtra("track", media.nowPlaying ?: media.title)
- .putExtra("artist", media.artist)
- .putExtra("album", media.album)
+ .putExtra("artist", MediaUtils.getMediaArtist(this at PlaybackService, media))
+ .putExtra("album", MediaUtils.getMediaAlbum(this at PlaybackService, media))
.putExtra("duration", media.length)
.putExtra("playing", isPlaying)
- .putExtra("package", "org.videolan.vlc"))
+ .putExtra("package", "org.videolan.vlc")
+ .apply {
+ if (lastChaptersCount > 0) getCurrentChapter()?.let { putExtra("chapter", it) }
+ })
}
}
More information about the Android
mailing list