javascript - Chromecast - Launch Media Via the CastMessageBus -
i developing custom chromecast receiver app. possible launch media via cast message bus? i'm aware it's not best practice , there mechanism launch media via gckmediacontrolchannel
i'm using https://github.com/googlecast/castreferenceplayer starting point.
i'm sending text message (containing media info json) via sender this:
[_castservicechannel sendtextmessage:mediainfojson];
the json being received on receiver , trying launch media player so:
sampleplayer.castplayer.prototype.loadvideo_(message);
but i'm not initialising media player properly. have ideas?
the problem me couldn't launch video because:
loadvideo_()
wrong method, should usingload()
- the player never initialised when receiving cast messages.
my solution separate cast message bus
messages player. in player.html
, init cast message bus
. when receive json
of media want play, init player.js
player.html
so:
//receive message play -> pass media through var player = document.getelementbyid('player'); new sampleplayer.castplayer(player).start();
then in
sampleplayer.castplayer.prototype.start = function() { this.load(json.parse(message)); };
only thing that's problem media manager
never initialised in cast receiver app
. means can't capture rcu events properly. ideas why happening?
Comments
Post a Comment