Chromecast receiver, how to load media without explicit cast sender request?

元气小坏坏 提交于 2019-11-28 05:13:04

问题


Media exists on an external server that I would like to play on my cast receiver (a modified version of Google's CastReferencePlayer). The receiver is in constant communication with this server (via long-polling), and is instructed by the server when it needs to play a certain media file.

The issue I'm having is that I need the receiver to be able to essentially "tell itself" to play this media. This breaks with the standard sender-receiver communication protocol, but is necessary for my application and I don't believe too outlandish of a request.

As I understand it, the MediaManager object automagically receives all requests from cast senders to play media. I am looking for a way to hook into the MediaManager and tell it to play certain media without receiving a formal request from a sender.

Despite a lot of searching and reading through documentation, I can't find a way to do this. Does anyone know of any way to accomplish this?


回答1:


i saw this on the google plus chromecast dev page, though i havent gotten it to work yet

Add/remove items using: https://developers.google.com/cast/docs/reference/receiver/cast.receiver.MediaManager#insertQueueItems, https://developers.google.com/cast/docs/reference/receiver/cast.receiver.MediaManager#removeQueueItems



来源:https://stackoverflow.com/questions/35881391/chromecast-receiver-how-to-load-media-without-explicit-cast-sender-request

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