New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cast] Convert MediaItem.playbackProperties.subtitles to MediaTracks #8669
Comments
Looking into the cast player extension, the non deprecated method Lines 59 to 70 in b100094
This seems to imply that all other metadata than the title are dropped during the conversion. @Samrobbo, are the new metadata fields planned contain subtitle, MEDIA_TYPE and image ? |
The new metadata fields will cover a large selection of things yes. The initial change will be fairly minimal, but it will be quick and easy to expand it, and fields like those listed are common ones that will no doubt be implemented early on. |
Thanks Sam. @gsavvid, until the new Metadata field are added, please continue to use the deprecated |
I don't think that use cases were missed, but as a library we can not know how an app want to pass arbitrary metadata. An app can add this behaviour though. With The It's true that the Does this cover you use case @gsavvid? |
It's true that you can't know how an app wants to pass arbitrary metadata but I'd expect that the metadata used by the Nevertheless, I ended up using the solution with the custom |
Thanks @gsavvid! Marking as an enhancement for now. I agree we could probably support the styled media receiver (context: https://developers.google.com/cast/docs/styled_receiver) better than we currently do. I think it uses MediaMetadata to get the data to display. We provide what we have like
Just some notes around what was the thinking when basic support was added for this with the converter: apart from the The problem to solve is for example, how to map metadata keys from Further, for a really nice solution we probably want to include in-band metadata that is for instance ID3 tags read from the media and also the duration which can only be properly determined after the media stream is read. We need to take into account that some of this data is available only when the media is prepared or even the media period is created for that source - so some time after the media item is built and added to the playlist. Like at the moment the user adds a list of We also probably want to have this working in both directions like #8212 suggests. So when the item is added to the cast queue on the cast device by another cast sender, it should be properly land in Androids media session like as if the user had added it to the ExoPlayer. Marked as an enhancement for now. |
@gsavvid beside my general comment above
Do you mean the title or the subtitle? We only have a title currently which we support here: What d o you refer to when mentioning the subtitle? |
Oh yes, sorry I should have been more specific regarding the subtitles. I was referring to the subtitle tracks. These are not added by default to the
|
Ha! After starring at the metadata keys for a while I got confused by MediaMetadata#KEY_SUBTITLE that the Styled Cast receiver probably is using. Didn't think about timed text subtitles :) @gsavvid! I think subtitles should be the first thing we add to the https://developers.google.com/cast/docs/android_sender/media_tracks |
Any update? I implemented the EnhancedItemConverter still not able to see subtitles on castplayer. |
@marcbaechinger any update? |
No updates I'm afraid. You need to create your own |
if you build MediaItemConverter support Subtitle can you share it? I build one but still no show subtitle in cast |
I haven't tested this but did you look into the version posted above? |
Previously, I would set the metadata like this:
Where
MediaMetadata
in the above example iscom.google.android.gms.cast.MediaMetadata
. Now thatCastPlayer.loadItem()
is deprecated, I want to replace it withPlayer.setMediaItem()
but I can't find how to pass the same metadata to aMediaItem
. I know that it acceptscom.google.android.exoplayer2.MediaMetadata
but this currently only has atitle
property.So my question is how can I set the title, subtitle, and image to be displayed in the cast receiver app using a
MediaItem
?The text was updated successfully, but these errors were encountered: