ios - 来自 YouTube 的 Chromecast iOS 发件人链接

标签 ios youtube chromecast

我想创建一个应用程序,它采用 YouTube URL 并在 iOS 的 chromecast 上播放它。

我按照 Google 的示例进行操作,但我的视频无法在 chromecast 上播放。

这是我用于 GCKMediaInformation 的代码:

   GCKMediaInformation *mediaInformation =
[[GCKMediaInformation alloc] initWithContentID:
 @"https://www.youtube.com/watch?v=t_WNRZ29WNI"
                                    streamType:GCKMediaStreamTypeNone
                                   contentType:@"video/mp4"
                                      metadata:metadata
                                streamDuration:0
                                    customData:nil];

有人可以帮我解决这个问题吗?

最佳答案

你不能那样做;您发送到 chromecast 的媒体 URL 是 YouTube 特定 URL;您需要发送一个指向支持的媒体格式的网址(请参阅支持的媒体格式列表here)

关于ios - 来自 YouTube 的 Chromecast iOS 发件人链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31116320/

相关文章:

ios - 分配周末 FSCalendar

ios - fontDescriptorWithMatrix 不工作

youtube - 如何使用 YouTube Data API v3 获取 channel 中所有视频的列表?

.net - Google API YouTube示例-错误:redirect_uri_mismatch

ios - html5 视频 - 在桌面上播放,iPhone 6s,不会在 5s 上播放?

iphone - iOS - 使用 UIBezierPath appendPath 剪切两个路径的并集

html - Youtube HTML5 iframe 嵌入在 IE 中播放

chromecast - 让 Chrome-Cast 应用程序保持事件状态并显示在通知栏中

android - remoteMediaPlayer.requestStatus(...) 返回状态代码 SIGN_IN_REQUIRED

ios - 带有 AVPlayer iOS 的 Chrome-cast