这是我到目前为止所做的: 1) 从 Github (cast-ios-sample) 下载了示例 ios 应用程序
2) 让我的设备被 Google 列入白名单并收到 App ID,像这样,当然改变了,但看起来类似于这个 abcdefgh-1234-5678-abcd-abcdefghijkl。
3) 将receiver.html 文件更新为
// Initialize and start the media playing receiver
var receiver = new cast.receiver.Receiver('abcdefgh-1234-5678-abcd-abcdefghijkl', [cast.receiver.RemoteMedia.NAMESPACE], "", 5);
4)在AWS S3存储桶中加载receiver.html并将其公开(我可以从浏览器下载文件,所以我确认它是公开的)。
5)在xcode中,修改GCKAppDelegate.m如下:
NSLog(@"Setting receiver url.");
//self.host = @"http://www.yourdomain.com/yourreceiver.html";
self.host = @"http://name_of_bucket.amazonaws.com/receiver.html";
6)在xcode中,修改GCKViewController.m如下: NSLog(@"Starting session."); [self.mSession startSessionWithApplication:@"abcdefgh-1234-5678-abcd-abcdefghijkl" 参数:self.applicationArgument];
7)我能够运行应用程序,并且可以在应用程序中看到我的 Chormecast,但是当我选择它时,我在 xcode 控制台中收到以下错误:
2013-08-09 11:49:20.746 ChromecastDemoApp[16077:c07] executing a GCKStartApplicationRequest with url=http://172.17.1.11:8008/apps/abcdefgh-1234-5678-abcd-abcdefghijkl
2013-08-09 11:49:20.747 ChromecastDemoApp[16077:c07] started POST request for: http://172.17.1.11:8008/apps/abcdefgh-1234-5678-abcd-abcdefghijkl and data: <GCKMimeData: 0xf8089c0>
2013-08-09 11:49:20.748 ChromecastDemoApp[16077:c07] Selected device: ChromecastXXXX
2013-08-09 11:49:20.796 ChromecastDemoApp[16077:c07] httpRequest:didCompleteWithStatusCode:404:data:0 bytes
2013-08-09 11:49:20.796 ChromecastDemoApp[16077:c07] Request failed with error: 5
2013-08-09 11:49:20.796 ChromecastDemoApp[16077:c07] tearDownSessionWithError: Error Domain=com.google.GCKFramework.GCKApplicationSessionError Code=1 "failed to start application (com.google.GCKFramework.GCKApplicationSessionError)"
2013-08-09 11:49:20.797 ChromecastDemoApp[16077:c07] all teardown steps complete
2013-08-09 11:49:20.797 ChromecastDemoApp[16077:c07] GCK Session failed to start: Error Domain=com.google.GCKFramework.GCKApplicationSessionError Code=1 "failed to start application (com.google.GCKFramework.GCKApplicationSessionError)"
8) 我无法通过访问 localhost:9222 使我的 Web 控制台正常工作。
对我做错的任何帮助将不胜感激。