问题
i am new to the google cast development. Currently i've successfully developed an app that can cast online media (e.g. this mp3) by using the RemoteMediaPlayer class.
Now i have tried to cast an YouTube video (this video) by using the same technique but it won't start casting. The callback of GoogleApiClient.load() says that the operation was not successful.
So, is it possible to cast a YouTube video (or another streaming platform videos such as vimeo) by using the RemoteMediaPlayer class?
回答1:
You need to have a link to the media, and media should be in one of the formats that is payable on Chromecast (see our documentation for accepted formats). Otherwise you will not be possible. For YouTube specifically, you don't have access to the mp4 files (at least not through YouTube APIs) so you cannot play a YT content in your app's receiver; some have tried using the embedded iframe but it is not always successful and it is limited.
来源:https://stackoverflow.com/questions/22779946/google-cast-sdk-remotemediaplayer-web-video-casting-e-g-youtube