media icon indicating copy to clipboard operation
media copied to clipboard

Cast Android TV Receiver - Correct implementation with Media3

Open TomasValenta opened this issue 1 year ago • 4 comments

What is the current best approach to implement the Cast Android TV Receiver SDK with Media3?

  • I did not find any useful information on this to date.
  • The Media3 Demo project directory contains only Cast Sender example.
  • ExoPlayer project related references Cast docs, CastAndroidTvReceiver example, Marc Medium post are all outdated, deprecated and they no longer exist in Media3 (ie MediaSessionConnector).
  • Based on findings from CastPlayer source code, it always uses remoteMediaClient.queueLoad method, which requires a specific approach on Receiver side.

I have a very basic implementation done at the moment, but I don't know exactly when and what to broadcast with the MediaStatus differently from the official example mentioned above.

For example (int) currentTimeline.getPeriod(mediaItemIndex, period).uid in CastPlayer seekTo method returns (after disconnection and after new connection) wrong value (exceeding the queue size). But this works fine with the Default Web Receiver App, so from this I conclude that I am missing something to properly integrate on the Receiver side.

Is there an official demo planned, like is there the one for Cast Sender?

TomasValenta avatar Nov 29 '23 14:11 TomasValenta