Chrome-cast Sample App doesn't work

北城余情 提交于 2019-12-12 16:11:31

问题


I managed to whitelisted my device and I got the AppID and also setup my receiver url. I am able to build and run the CastSample App. I can click the cast button and my TV shows a blank screen. I tried to select one media from the list but nothing is displayed on my TV.

From the log I see the follwoing error some seconds after I clicked the cast button. Am I missing anything?

07-30 20:29:12.895: W/StartSessionTask(19880): Expected a channel but never got a connection service URL
07-30 20:29:12.895: E/ApplicationSession(19880): StartSessionTask failed with error: failed to start application: no channel info received
07-30 20:29:12.900: E/CastSampleActivity(19880): onStartFailed failed to start application: no channel info received
07-30 20:39:58.690: V/CastSampleActivity(21776): Selecting Media
07-30 20:39:58.735: D/AbsListView(21776): Get MotionRecognitionManager
07-30 20:40:03.890: V/MediaSelectionDialog(21776): Selected media: Big Buck Bunny
07-30 20:40:34.055: V/CastSampleActivity(21776): onStop called and callback removed
07-30 20:41:05.870: V/CastSampleActivity(21776): onStart called and callback added

回答1:


I checked the cast-android-sample on github and find that they have updated the receiver.html to have:

// Initialize and start the media playing receiver
var receiver = new cast.receiver.Receiver(
    'YOUR_APP_ID_HERE', 
    [cast.receiver.RemoteMedia.NAMESPACE],
    "",
    5);

Then I put my AppID there and uploaded the new receiver.html to my server then restarted everything and now I am able to play these sample medias.



来源:https://stackoverflow.com/questions/17959825/chrome-cast-sample-app-doesnt-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!