我无法将简单的JPG或PNG文件转换为chromecast设备。 我一直收到错误消息
[cast.receiver.MediaManager] Load metadata error
我甚至尝试使用Google的示例“sample_media_receiver.html”和“web_sender_tool.html”,但没有成功。
像MP4甚至HLS这样的视频文件可以正常工作,但不是简单的图像。在默认接收器中,图像正常工作,但不在自定义接收器中。
我尝试使用不同的元数据值而没有任何元数据 - 没有任何帮助。
这是chromecast控制台的日志(有工作的MP4而不是JPG):
### Application Loaded. Starting system. sample_media_receiver.html:605
[ 0.285s] [cast.receiver.IpcChannel] Opening message bus websocket
cast_receiver.js:19
[ 0.297s] [goog.net.WebSocket] Opening the WebSocket on ws://localhost:8008/v2/ipc
cast_receiver.js:19
[ 0.369s] [goog.net.WebSocket] WebSocket opened on ws://localhost:8008/v2/ipc
cast_receiver.js:19
[ 0.380s] [cast.receiver.IpcChannel] IpcChannel opened
cast_receiver.js:19
[ 0.393s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message [urn:x-cast:com.google.cast.system, SystemSender]: {"type":"opened"}
cast_receiver.js:19
[ 0.408s] [cast.receiver.CastReceiverManager] CastReceiverManager message received: [object Object]
cast_receiver.js:19
[ 0.410s] [cast.receiver.CastReceiverManager] Underlying message bus is open
cast_receiver.js:19
[ 0.413s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender","data":"{\"type\":\"ready\",\"statusText\":\"Ready to play\",\"activeNamespaces\":[\"urn:x-cast:com.google.devrel.custom\",\"urn:x-cast:com.google.cast.media\"],\"version\":\"2.0.0\",\"messagesVersion\":\"1.0\"}"}
cast_receiver.js:19
[ 0.421s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender","data":"{\"type\":\"startheartbeat\",\"maxInactivity\":6000}"}
cast_receiver.js:19
[ 0.440s] [cast.receiver.IpcChannel] Received message: {"data":"{\"applicationId\":\"XXXXXXX\",\"applicationName\":\"MDTest\",\"launchingSenderId\":\"8:client-68103\",\"messagesVersion\":\"1.0\",\"sessionId\":\"2A80FF6F-F9B2-4D78-D99A-997CF6FC2F69\",\"type\":\"ready\",\"version\":\"1.0\"}","namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender"}
cast_receiver.js:19
[ 0.443s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message [urn:x-cast:com.google.cast.system, SystemSender]: {"applicationId":"XXXXXXXX","applicationName":"MDTest","launchingSenderId":"8:client-68103","messagesVersion":"1.0","sessionId":"2A80FF6F-F9B2-4D78-D99A-997CF6FC2F69","type":"ready","version":"1.0"}
cast_receiver.js:19
[ 0.446s] [cast.receiver.CastReceiverManager] CastReceiverManager message received: [object Object]
cast_receiver.js:19
[ 0.448s] [cast.receiver.CastReceiverManager] Dispatching CastReceiverManager system ready event [[object Object]]
cast_receiver.js:19
### Cast Receiver Manager is READY: sample_media_receiver.html:204
[ 0.567s] [cast.receiver.IpcChannel] Received message: {"data":"{\"senderId\":\"8:client-68103\",\"type\":\"senderconnected\",\"userAgent\":\"\"}","namespace":"urn:x-cast:com.google.cast.system","senderId":"SystemSender"}
cast_receiver.js:19
[ 0.570s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message [urn:x-cast:com.google.cast.system, SystemSender]: {"senderId":"8:client-68103","type":"senderconnected","userAgent":""}
cast_receiver.js:19
[ 0.572s] [cast.receiver.CastReceiverManager] CastReceiverManager message received: [object Object]
cast_receiver.js:19
[ 0.574s] [cast.receiver.CastReceiverManager] Dispatching CastReceiverManager sender connected event [8:client-68103]
cast_receiver.js:19
[ 0.576s] [cast.receiver.CastMessageBus] Registering sender [urn:x-cast:com.google.devrel.custom, 8:client-68103]
cast_receiver.js:19
[ 0.578s] [cast.receiver.CastMessageBus] Registering sender [urn:x-cast:com.google.cast.media, 8:client-68103]
cast_receiver.js:19
### Cast Receiver Manager - Sender Connected : sample_media_receiver.html:217
[ 17.252s] [cast.receiver.IpcChannel] Received message: {"data":"{\"type\":\"LOAD\",\"requestId\":28532030,\"sessionId\":\"2A80FF6F-F9B2-4D78-D99A-997CF6FC2F69\",\"media\":{\"contentId\":\"http://192.168.0.103/~marco/cast/video0.mp4\",\"streamType\":\"buffered\",\"contentType\":\"video/mp4\",\"metadata\":null,\"duration\":null,\"customData\":null},\"autoplay\":true,\"currentTime\":null,\"customData\":null}","namespace":"urn:x-cast:com.google.cast.media","senderId":"8:client-68103"}
cast_receiver.js:19
[ 17.255s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message [urn:x-cast:com.google.cast.media, 8:client-68103]: {"type":"LOAD","requestId":28532030,"sessionId":"2A80FF6F-F9B2-4D78-D99A-997CF6FC2F69","media":{"contentId":"http://192.168.0.103/~marco/cast/video0.mp4","streamType":"buffered","contentType":"video/mp4","metadata":null,"duration":null,"customData":null},"autoplay":true,"currentTime":null,"customData":null}
cast_receiver.js:19
[ 17.258s] [cast.receiver.MediaManager] MediaManager message received [8:client-68103] {"type":"LOAD","requestId":28532030,"sessionId":"2A80FF6F-F9B2-4D78-D99A-997CF6FC2F69","media":{"contentId":"http://192.168.0.103/~marco/cast/video0.mp4","streamType":"buffered","contentType":"video/mp4","metadata":null,"duration":null,"customData":null},"autoplay":true,"currentTime":null,"customData":null}
cast_receiver.js:19
[ 17.259s] [cast.receiver.MediaManager] Dispatching MediaManager load event
cast_receiver.js:19
### Media Manager - LOAD: {"type":"load","B":false,"defaultPrevented":false,"Qa":true,"data":{"requestId":28532030,"sessionId":"2A80FF6F-F9B2-4D78-D99A-997CF6FC2F69","media":{"contentId":"http://192.168.0.103/~marco/cast/video0.mp4","streamType":"buffered","contentType":"video/mp4","metadata":null,"duration":null,"customData":null},"autoplay":true,"currentTime":null,"customData":null},"senderId":"8:client-68103"} sample_media_receiver.html:549
### Media Protocol Identified as mp4 sample_media_receiver.html:588
######### MEDIA ELEMENT LOAD START sample_media_receiver.html:121
[ 18.270s] [cast.receiver.MediaManager] Metadata loaded
cast_receiver.js:19
[ 18.286s] [cast.receiver.MediaManager] Sending broadcast status message
cast_receiver.js:19
[ 18.300s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"*:*","data":"{\"type\":\"MEDIA_STATUS\",\"status\":[{\"mediaSessionId\":1,\"playbackRate\":1,\"playerState\":\"BUFFERING\",\"currentTime\":0,\"supportedMediaCommands\":15,\"volume\":{\"level\":1,\"muted\":false},\"media\":{\"contentId\":\"http://192.168.0.103/~marco/cast/video0.mp4\",\"streamType\":\"buffered\",\"contentType\":\"video/mp4\",\"metadata\":null,\"duration\":8.057324,\"customData\":null}}],\"requestId\":28532030}"}
cast_receiver.js:19
######### MEDIA ELEMENT DATA LOADED sample_media_receiver.html:125
######### MEDIA ELEMENT CAN PLAY sample_media_receiver.html:129
######### MEDIA ELEMENT PLAYING sample_media_receiver.html:137
[ 20.625s] [cast.receiver.MediaManager] Buffering state changed, isPlayerBuffering: false old time: 0.083322 current time: 1.125
cast_receiver.js:19
[ 20.627s] [cast.receiver.MediaManager] Sending broadcast status message
cast_receiver.js:19
[ 20.630s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"*:*","data":"{\"type\":\"MEDIA_STATUS\",\"status\":[{\"mediaSessionId\":1,\"playbackRate\":1,\"playerState\":\"PLAYING\",\"currentTime\":1.125,\"supportedMediaCommands\":15,\"volume\":{\"level\":1,\"muted\":false}}],\"requestId\":0}"}
cast_receiver.js:19
######### MEDIA ELEMENT ENDED sample_media_receiver.html:133
### Media Manager - ENDED: sample_media_receiver.html:347
[ 27.445s] [cast.receiver.MediaManager] Resetting media element
cast_receiver.js:19
[ 27.579s] [cast.receiver.MediaManager] Sending broadcast status message
cast_receiver.js:19
[ 27.581s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"*:*","data":"{\"type\":\"MEDIA_STATUS\",\"status\":[{\"mediaSessionId\":1,\"playbackRate\":1,\"playerState\":\"IDLE\",\"currentTime\":0,\"supportedMediaCommands\":15,\"volume\":{\"level\":1,\"muted\":false},\"idleReason\":\"FINISHED\"}],\"requestId\":0}"}
cast_receiver.js:19
######### MEDIA ELEMENT ABORT [object Event] sample_media_receiver.html:153
[ 31.019s] [cast.receiver.IpcChannel] Received message: {"data":"{\"type\":\"LOAD\",\"requestId\":28532031,\"sessionId\":\"2A80FF6F-F9B2-4D78-D99A-997CF6FC2F69\",\"media\":{\"contentId\":\"http://192.168.0.103/~marco/cast/myimage.jpg\",\"streamType\":\"buffered\",\"contentType\":\"image/jpg\",\"metadata\":null,\"duration\":null,\"customData\":null},\"autoplay\":true,\"currentTime\":null,\"customData\":null}","namespace":"urn:x-cast:com.google.cast.media","senderId":"8:client-68103"}
cast_receiver.js:19
[ 31.028s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message [urn:x-cast:com.google.cast.media, 8:client-68103]: {"type":"LOAD","requestId":28532031,"sessionId":"2A80FF6F-F9B2-4D78-D99A-997CF6FC2F69","media":{"contentId":"http://192.168.0.103/~marco/cast/myimage.jpg","streamType":"buffered","contentType":"image/jpg","metadata":null,"duration":null,"customData":null},"autoplay":true,"currentTime":null,"customData":null}
cast_receiver.js:19
[ 31.031s] [cast.receiver.MediaManager] MediaManager message received [8:client-68103] {"type":"LOAD","requestId":28532031,"sessionId":"2A80FF6F-F9B2-4D78-D99A-997CF6FC2F69","media":{"contentId":"http://192.168.0.103/~marco/cast/myimage.jpg","streamType":"buffered","contentType":"image/jpg","metadata":null,"duration":null,"customData":null},"autoplay":true,"currentTime":null,"customData":null}
cast_receiver.js:19
[ 31.033s] [cast.receiver.MediaManager] Dispatching MediaManager load event
cast_receiver.js:19
### Media Manager - LOAD: {"type":"load","B":false,"defaultPrevented":false,"Qa":true,"data":{"requestId":28532031,"sessionId":"2A80FF6F-F9B2-4D78-D99A-997CF6FC2F69","media":{"contentId":"http://192.168.0.103/~marco/cast/myimage.jpg","streamType":"buffered","contentType":"image/jpg","metadata":null,"duration":null,"customData":null},"autoplay":true,"currentTime":null,"customData":null},"senderId":"8:client-68103"} sample_media_receiver.html:549
### Media Protocol Identified as jpg sample_media_receiver.html:588
######### MEDIA ELEMENT LOAD START sample_media_receiver.html:121
######### MEDIA ELEMENT ERROR [object Event] sample_media_receiver.html:149
[ 31.293s] [cast.receiver.MediaManager] Load metadata error
cast_receiver.js:19
### Media Manager - LOAD METADATA ERROR: {"senderId":"8:client-68103","message":{"requestId":28532031,"sessionId":"2A80FF6F-F9B2-4D78-D99A-997CF6FC2F69","media":{"contentId":"http://192.168.0.103/~marco/cast/myimage.jpg","streamType":"buffered","contentType":"image/jpg","metadata":null,"duration":null,"customData":null},"autoplay":true,"currentTime":null,"customData":null}} sample_media_receiver.html:399
[ 31.297s] [cast.receiver.MediaManager] Resetting media element
cast_receiver.js:19
[ 31.303s] [cast.receiver.MediaManager] Sending error message to 8:client-68103
cast_receiver.js:19
[ 31.305s] [cast.receiver.IpcChannel] IPC message sent: {"namespace":"urn:x-cast:com.google.cast.media","senderId":"8:client-68103","data":"{\"requestId\":28532031,\"type\":\"LOAD_FAILED\"}"}
有什么问题?
答案 0 :(得分:0)
当您说“自定义接收器”时,表示您已编写自己的接收器。这样做时,您是否为图像添加了<img/>
标记以及将该元素用于图像的相关逻辑?听起来你没有。 Styled和Default接收器就是这样做的,因此在使用这些接收器时可以看到图像。