-
Notifications
You must be signed in to change notification settings - Fork 6k
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
MediaItemConverter does not convert MediaQueueItem to MediaItem #8212
Comments
Same here, any updates? I can not find a way to alter the CastPlayer behavior in any way since it is not extendable, we can not override timeline implementation or something like this. So for now I also stuck with this kind of workaround, which I don't really like. Thanks! |
I marked this issue as enhancement. We should convert Thanks for your comment @makp9k Are you looking for altering the |
If |
Currently, CastTimeline doesn't care about MediaItem and it works only with itemIds and also with this
Setting an empty mediaItem with only the index as a tag is such a hidden thing. Please, at least comment such stuff. |
@marcbaechinger this is kind of a bug? CurrentMediaItem is always empty one, it is not returned correctly. |
The reason for which we are not bringing in the Timeline from the receiver is that the Cast default receiver does not behave reliably, so that we can guarantee a consistent state across all senders and the receiver. I've recently revisited this, but I haven't been able to make progress. If you have some time to invest in this, I encourage you to send a pull request. It will be more than welcome. |
The media item needs to be assigned to `Window.mediaItem` in `CastTimeline.setWindow`. For this the `MediaItem` needs to be available in the timeline. When a `MediaItem` is passed to the `set/addMediaItems` method, we can't yet know the Cast `MediaQueueItem.itemId` that is generated on the device and arrives with an async update of the `RemoteMediaClient` state. Hence in the `CastTimelineTracker`, we need to store the `MediaItem` by Casts's `MediaItem.contentId`. When we then receive the updated queue, we look the media item up by the content ID to augment the `ItemData` that is available in the `CastTimeline`. Issue: #25 Issue: google/ExoPlayer#8212 #minor-release PiperOrigin-RevId: 460325235
The media item needs to be assigned to `Window.mediaItem` in `CastTimeline.setWindow`. For this the `MediaItem` needs to be available in the timeline. When a `MediaItem` is passed to the `set/addMediaItems` method, we can't yet know the Cast `MediaQueueItem.itemId` that is generated on the device and arrives with an async update of the `RemoteMediaClient` state. Hence in the `CastTimelineTracker`, we need to store the `MediaItem` by Casts's `MediaItem.contentId`. When we then receive the updated queue, we look the media item up by the content ID to augment the `ItemData` that is available in the `CastTimeline`. Issue: androidx/media#25 Issue: #8212 #minor-release PiperOrigin-RevId: 460325235
Fixed by the commits above. |
I think we need #9078 also to have this properly working. |
The media item needs to be assigned to `Window.mediaItem` in `CastTimeline.setWindow`. For this the `MediaItem` needs to be available in the timeline. When a `MediaItem` is passed to the `set/addMediaItems` method, we can't yet know the Cast `MediaQueueItem.itemId` that is generated on the device and arrives with an async update of the `RemoteMediaClient` state. Hence in the `CastTimelineTracker`, we need to store the `MediaItem` by Casts's `MediaItem.contentId`. When we then receive the updated queue, we look the media item up by the content ID to augment the `ItemData` that is available in the `CastTimeline`. Issue: androidx/media#25 Issue: #8212 #minor-release PiperOrigin-RevId: 460325235 (cherry picked from commit 02e1484)
The media item needs to be assigned to `Window.mediaItem` in `CastTimeline.setWindow`. For this the `MediaItem` needs to be available in the timeline. When a `MediaItem` is passed to the `set/addMediaItems` method, we can't yet know the Cast `MediaQueueItem.itemId` that is generated on the device and arrives with an async update of the `RemoteMediaClient` state. Hence in the `CastTimelineTracker`, we need to store the `MediaItem` by Casts's `MediaItem.contentId`. When we then receive the updated queue, we look the media item up by the content ID to augment the `ItemData` that is available in the `CastTimeline`. Issue: #25 Issue: google/ExoPlayer#8212 #minor-release PiperOrigin-RevId: 460325235 (cherry picked from commit 30fbc3a)
Most of the issues above were already addressed by keeping the local |
Hi, I am working with CastPlayer and I have some questions about the recovery of the current session.
The scenario is:
The problem here is; the MediaItem currentMediaItem present in the Player interface is not recovered correctly, coming with empty fields. I was looking at the codes, in the MediaItemConverter and realised that the method toMediaItem (MediaQueueItem mediaQueueItem) is called only on tests. Is it possible to make CastPlayer use this method and be able to set the currentMediaItem correctly? This would be helpful, as it would make it easier to check if a content that i'am opening was already being played on TV before the session was recovered by reopening the application.
Today, i need to access the CastContext to recover the session and then convert the MediaQueueItem to MediaItem:
Thanks.
The text was updated successfully, but these errors were encountered: