androidx / androidx/media

CastPlayer: Update local MediaItem with data from MediaQueueItem (e.g. how to support custom fields sent from receiver)

Open
#1,623 10 comments 1 reaction 1 assignee View on GitHub

@tonihei is already working on this.

Since Aug 15, 2024.

enhancement
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

We are a national streaming business trying to rewrite our ExoPlayer and Cast sender SDK specific implementations of playback and move to using the Media3 APIs instead to allow for more consistent code and test code for cast and local playback streaming.

Our setup is as follows:

  • We have a custom cast receiver
  • We have an android app with a custom cast controller (both for extended and minimized versions) using the RemoteMediaClient and CastContext APIs to listen for playback changes on the cast device.
  • We are a flow TV streaming business and thus support streaming of programs currently playing on flow TV on local channels, and we have support for starting these streams over and little features like only allowing seeking to previously played positions in streams etc. This means we have some custom properties that the receiver sends to the cast sender app.
  • We have multiple platform apps (iOS, Android, AndroidTV, AppleTV, Browser etc.), and thus our cast receiver is doing some logic like getting the stream URI, the drm license Uri and other things and broadcasting those to the apps to make sure we do not need to do these implementations on all our platforms and instead let the cast device do them.
    This is done by the receiver putting json data inside the customData field, and then our old implementation uses the RemoteMediaClient.Callback.onMetadataUpdated to read the values when they change during the stream.

My question is, is there a way for us to receive the customData that the Cast receiver sends out using only the Media3 APIs? inside the CastPlayer class the callback method we use is just empty. I have tried the different callback functions in the Player.Listener interface but it seems none of them exposes the data the cast device puts in the customData field.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.