昨天一切似乎都有效,但我的代码中有可能改变了一些内容,我只是无法找出它为什么不再起作用了:
发件人JAVA代码:
MediaMetadata mediaMetadata = new MediaMetadata(MediaMetadata.MEDIA_TYPE_MOVIE);
mediaMetadata.putString(MediaMetadata.KEY_TITLE, "My video");
mediaMetadata.putString(MediaMetadata.KEY_SUBTITLE, "My video sub title");
mediaMetadata.putString(MediaMetadata.KEY_STUDIO, "Studio");
mediaMetadata.addImage(new WebImage(Uri.parse("http://xxxx.xx/files/RMCipadPics/ipadtv.png")));
mediaMetadata.addImage(new WebImage(Uri.parse("http://xxxx.xx/files/RMCipadPics/ipadtv.png")));//big image
MediaInfo mediaInfo = new MediaInfo.Builder(
url)
.setContentType("application/x-mpegURL")
.setStreamType(MediaInfo.STREAM_TYPE_BUFFERED)
.setMetadata(mediaMetadata)
.build();
mVideoCastManager.startCastControllerActivity(StreamVideo.this, mediaInfo, 0, true);
使用媒体播放器库(https://developers.google.com/cast/docs/player)中的接收器的示例代码,除了一些日志记录之外我没有更改
调试日志(删除了个人信息)显示:
Starting media application
we have protocol .m3u8
Starting Media Player Library
Uncaught InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable. media_player.js:102
[ 46.310s] [cast.receiver.MediaManager] Load metadata error
cast_receiver.js:19
[ 46.322s] [cast.receiver.MediaManager] Resetting media element
cast_receiver.js:19
[ 46.334s] [cast.receiver.MediaManager] Sending error message to 10:xx.xxxx.xxxx-54
cast_receiver.js:19
[ 46.346s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"10:xx.xxxx.xxxx-54","data":"{\"requestId\":2,\"type\":\"LOAD_FAILED\"}"}
cast_receiver.js:19
[ 46.191s] [cast.player.api.Player] error
media_player.js:24
Fatal Error - 1 player.html:87