Skip to content

Fix Showcase MediaSession Service#1260

Merged
StaehliJ merged 2 commits intomainfrom
fix-demo-media-session-service
Mar 4, 2026
Merged

Fix Showcase MediaSession Service#1260
StaehliJ merged 2 commits intomainfrom
fix-demo-media-session-service

Conversation

@StaehliJ
Copy link
Contributor

@StaehliJ StaehliJ commented Mar 4, 2026

Description

When using a PillarboxMediaController the all Window.uuid are equals to 0 during the source resolution, that's why the Showcase MediaSessionService that using that kind of player crashs when adding more than 1 item. The LazyRow needs to have unique key for each media item.

Changes made

  • Add an ui extension to get a unique key, Player.getUniqueKeyForMediaItemIndex to pillarbox-ui module
LazyColumn {
        itemsIndexed(
            items = mediaItems,
            key = { index, item -> player.getUniqueKeyForMediaItemIndex(index) },
        ) { index, mediaItem ->
            MediaItemView(....)
        }
    }

Editing the playlist by dragging items won't work like with other showcases.

Checklist

  • APIs have been properly documented (if relevant).
  • The documentation has been updated (if relevant).
  • New unit tests have been written (if relevant).
  • The demo has been updated (if relevant).

StaehliJ added 2 commits March 4, 2026 14:38
…t behavrio.

PlaylistView doesn't work well with Cast as we create new MediaItem on each update.
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Pillarbox Mar 4, 2026
@StaehliJ StaehliJ enabled auto-merge March 4, 2026 14:41
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Code Coverage

Overall Project 44.48% -0.1% 🟢
Files changed 0% 🟢

Module Coverage
:pillarbox-ui 2.58% -0.57% 🟢
Files
Module File Coverage
:pillarbox-ui ComposablePlayer.kt 0% -3.53% 🟢

@StaehliJ StaehliJ added this pull request to the merge queue Mar 4, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 4, 2026
@StaehliJ StaehliJ added this pull request to the merge queue Mar 4, 2026
Merged via the queue into main with commit 1c183d6 Mar 4, 2026
12 checks passed
@StaehliJ StaehliJ deleted the fix-demo-media-session-service branch March 4, 2026 15:11
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Pillarbox Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant