我正尝试使用以下代码通过我的Android发送者应用在我注册的StyledMediaReceiver上加载MP4视频:
mediaMetadata = new MediaMetadata(
MediaMetadata.MEDIA_TYPE_MOVIE);
mediaMetadata.putString(MediaMetadata.KEY_TITLE, "My video");
mediaInfo = new MediaInfo.Builder(
"https://commondatastorage.googleapis.com/gtv-videos-
bucket/sample/DesigningForGoogleCast.mp4")
.setContentType("video/mp4")
.setStreamType(MediaInfo.STREAM_TYPE_BUFFERED)
.setMetadata(mediaMetadata).build();
try {
mRemoteMediaPlayer
.load(mGoogleApiClient, mediaInfo, true)
}
但是,接收器始终会为MP4视频的任何链接记录404 Not Found错误。这是我得到的日志:
Failed to load resource: the server responded with a status of 404 (Not Found)
cast_receiver.js:37 [ 0.266s] [cast.receiver.CastReceiverManager] Version: 2.0.0.0029
cast_receiver.js:37 [ 0.317s] [goog.net.WebSocket] Opening the WebSocket on ws://localhost:8008/v2/ipc
cast_receiver.js:26 Mixed Content: The page at 'https://www.gstatic.com/eureka/player/player.html?skin' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://localhost:8008/v2/ipc'. This endpoint should be available via WSS. Insecure access is deprecated.
cast_receiver.js:26 Connecting to a non-secure WebSocket server from a secure origin is deprecated.
cast_receiver.js:37 [ 0.385s] [goog.net.WebSocket] WebSocket opened on ws://localhost:8008/v2/ipc
https://www.gstatic.com/eureka/player/undefined Failed to load resource: the server responded with a status of 404 (Not Found)
有人可以指点我解决这个问题吗?