问题
I'm trying to get started with Chromecast as well as Airplay, and I'm a bit stuck : is it possible to send directly a UIViewController to the Chromecast-connected device? From what I looked, it seems I am only able to send basic media (image, text, video) to the device. So, if I understand, the only solution would be to "re-create" the interface by sending the components one by one? (is that even possible? or can you display only one media at once?)
Thanks
回答1:
You can create custom channels using HTML5 and you can stream to in-built receiver apps, but no, you cannot send a UIView directly to a Chromecast device
回答2:
What you want to use is called "Cast Remote Display". It's currently experimental but shows up in the docs here:
https://developers.google.com/cast/docs/remote
...and there is a sample project here:
https://github.com/googlecast/CastRemoteDisplay-iOS
The sample worked for me without any trouble. Note: you will have to register an app on the cast portal and also register your test device. There was a $5 fee. (There are three types, for this you need to select "Remote Display Receiver") Portal link:
https://cast.google.com/publish/#/applications/new
来源:https://stackoverflow.com/questions/22501831/sending-custom-uiviewcontroller-by-chromecast