Closed cl3m closed 6 years ago
Sorry for the late answer. Yes, this is definitely something we intend to deliver in a hopefully not so distant future. What remains to be investigated is whether Chromecast support must be actually implemented in the library or not.
Given the recent changes of Chromecast V3, it seems possible that Chromecast support could be better implemented at the application level. We should provide all necessary hooks in our library, of course. We could maybe provide a companion framework as well to fill the gap.
The implementation of Google Cast in our application (itself based on SRG MediaPlayer) is almost finished, and I now understand how Google Cast works and how it must be integrated in applications. I can therefore properly answer your feature request:
AVPlayer
instance seamlessly transform into a proxy for content played on the receiver. Integrating Google Cast, though, is rather integrating shared remote controls for content played on the receiver. AVPlayer
instance is required at all. In fact, you could imagine having a Google Cast compatible application which can itself not play any media on the device.AVPlayer
instance from a single application. For all these reasons, I am now convinced that SRG MediaPlayer cannot provide any Google Cast integration. SRG MediaPlayer controller is strongly related to an AVPlayer
instance and therefore promotes SRG MediaPlayer controllers as authorities to control playback. This is in direct opposition to how Google Cast works, with the receiver being the playback authority, and the device only a remote control.
Google Cast integration is moreover the responsibility of the application itself, since SRG MediaPlayer must not make any assumptions about the view controller hierarchy and how Google Cast player views should be presented. Moreover, SRG MediaPlayer has no access to metadata information it could supply to Google Cast, unlike the application itself. Attempting to provide additional abstractions to provide for such flexibility at the SRG MediaPlayer level would lead to additional complexity.
Issue overview
Chromecast support would be a great even on iOS. Many media player do support it (ARTE, Vimeo, YouTube, ..). More info at https://developers.google.com/cast/docs/developers