2

I am trying to play/push a MP4 to my receiver app on my whitelisted device.

I am able to launch my receiver app (an web page with a video tag).

Once I launch my receiver app, then from my Sender app (another web page) I do this:

new MediaLoadRequest(url);
cast_api.loadMedia(activityId, mediaRequest, callback);

My receiver looks like this:

initReceiver = function(){

_remoteMedia.setMediaElement(videoSurface);

_remoteMedia.onOpen = mediaOnOpen;

_remoteMedia.onLoad = mediaOnLoad;       
_remoteMedia.onLoadMetadataError = mediaMetaDataError;
_remoteMedia.onMetadataLoaded = mediaMetaDataLoaded;

_receiver.start();
mediaOnLoad = function (channel, message){
    _remoteMedia.load(channel, message);
    _remoteMedia.sendSuccessResponse(channel,message);  

}

mediaMetaDataLoaded = function (channel, message){
    console.log("mediaMetaDataLoaded", message);
}

mediaMetaDataError = function (channel,message){
    console.log("mediaMetaDataError", message);
}

mediaOnOpen = function (event){
    console.log("mediaOnOpen", event);          
}

On the console output the last message I see is this, after the code hits _remoteMedia.load:

[ 41.321s] [cast.receiver.RemoteMedia] loading media

and nothing happens after that. The media is a valid URL from my DropBox...an MP4.

Any ideas what I am doing wrong here?

Thanks!

4

1 回答 1

1

您实际上可以使用我们的默认接收器,它会播放您的内容。无需提供所有这些额外功能。

于 2013-08-14T19:12:06.697 回答