播放音频流时,演员设备会冻结

时间:2017-03-20 10:59:50

标签: chromecast google-cast

我在播放某些第三方音频流时遇到问题。我非常依赖https://developers.google.com/cast/docs/player,并按照这些说明如何创建自定义接收器来播放流。

在启动流后一秒钟左右(我没有听到任何声音),Cast设备冻结,他们停止响应Chrome的调试,他们不会对停止Cast会话作出反应。通常他们是如此锁定,甚至通过家庭应用程序发出重新启动不起作用;我必须断开电源。

Chromecast v2(1.22.79313),Chromecast Ultra(1.22.78017)和Google Home(1.22.78295)的行为相同。

冻结的原因是什么?这是由一些非常破碎的溪流造成的吗?这是一个已知的问题吗?有没有解决方法?不应该期望Cast设备处理这个并提供一些错误消息而不是像这样崩溃吗?

这是我在重置连接之前从Chrome开发者工具获得的日志:

cast_receiver.js:67  [  0.268s] [cast.receiver.IpcChannel] Opening platform websocket
cast_receiver.js:67  [  0.292s] [cast.receiver.CastReceiverManager] Version: 2.0.0.0049
cast_receiver.js:67  [  0.305s] [cast.receiver.MediaManager] Using default Player
cast_receiver.js:67  [  0.314s] [cast.receiver.IpcChannel] Opening message bus websocket
cast_receiver.js:67  [  0.322s] [cast.receiver.IpcChannel] IpcChannel opened
cast_receiver.js:67  [  0.326s] [cast.receiver.CastMessageBus] Dispatching CastMessageBus message
cast_receiver.js:67  [  0.333s] [cast.receiver.CastReceiverManager] Underlying message bus is open
[...]
media_player.js:25  [  0.628s] [cast.player.api.Player] Version: 1.0.0.40
[...]
media_player.js:25  [  6.682s] [cast.player.api.Player] load
media_player.js:25  [  6.707s] [goog.net.XhrIo] Opening Xhr [GET http://thirdpartyserver.example.com/playlist.m3u8 -1]
media_player.js:25  [  6.721s] [goog.net.XhrIo] Will abort after 30000ms if incomplete, xhr2 false [GET http://thirdpartyserver.example.com/playlist.m3u8 -1]
media_player.js:25  [  6.725s] [goog.net.XhrIo] Sending request [GET http://thirdpartyserver.example.com/playlist.m3u8 -1]
media_player.js:51 Mixed Content: The page at 'https://example.com/custom_receiver.html?debug=true' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://thirdpartyserver.example.com/playlist.m3u8'. This content should also be served over HTTPS.
media_player.js:25  [  6.735s] [cast.player.core.MediaSourceManager] open
media_player.js:25  [  6.923s] [goog.net.XhrIo] Request complete [GET http://thirdpartyserver.example.com/playlist.m3u8 200]
media_player.js:25  [  6.975s] [cast.player.core.QualityManager] 0: initial 82625
media_player.js:25  [  6.986s] [cast.player.hls.Playlist] update: http://thirdpartyserver.example.com/chunklist_w941582493.m3u8
media_player.js:25  [  6.993s] [goog.net.XhrIo] Opening Xhr [GET http://thirdpartyserver.example.com/chunklist_w941582493.m3u8 -1]
media_player.js:25  [  6.999s] [goog.net.XhrIo] Will abort after 30000ms if incomplete, xhr2 false [GET http://thirdpartyserver.example.com/chunklist_w941582493.m3u8 -1]
media_player.js:25  [  7.004s] [goog.net.XhrIo] Sending request [GET http://thirdpartyserver.example.com/chunklist_w941582493.m3u8 -1]
media_player.js:51 Mixed Content: The page at 'https://example.com/custom_receiver.html?debug=true' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://thirdpartyserver.example.com/chunklist_w941582493.m3u8'. This content should also be served over HTTPS.
media_player.js:25  [  7.127s] [goog.net.XhrIo] Request complete [GET http://thirdpartyserver.example.com/chunklist_w941582493.m3u8 200]
media_player.js:25  [  7.140s] [cast.player.hls.Playlist] update in: 3000
media_player.js:25  [  7.161s] [cast.player.core.SegmentManager] 0: seek success 0
media_player.js:25  [  7.169s] [goog.net.XhrIo] Opening Xhr [GET http://thirdpartyserver.example.com/media_w941582493_4220443.aac -1]
media_player.js:25  [  7.174s] [goog.net.XhrIo] Will abort after 10000ms if incomplete, xhr2 false [GET http://thirdpartyserver.example.com/media_w941582493_4220443.aac -1]
media_player.js:25  [  7.180s] [goog.net.XhrIo] Sending request [GET http://thirdpartyserver.example.com/media_w941582493_4220443.aac -1]
media_player.js:51 Mixed Content: The page at 'https://example.com/custom_receiver.html?debug=true' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://thirdpartyserver.example.com/media_w941582493_4220443.aac'. This content should also be served over HTTPS.
media_player.js:25  [  7.311s] [goog.net.XhrIo] Request complete [GET http://thirdpartyserver.example.com/media_w941582493_4220443.aac 200]
media_player.js:25  [  7.322s] [cast.player.core.QualityManager] 0: current=1018961.04, average=1444314.43
media_player.js:25  [  7.330s] [cast.player.core.SegmentManager] 0: process segment
media_player.js:25  [  7.338s] [cast.player.hls.Adaptation] process segment
media_player.js:25  [  7.357s] [cast.player.core.SegmentManager] 0: segment processed
media_player.js:25  [  7.363s] [cast.player.core.SourceBufferManager] 0: queue append
media_player.js:25  [  7.382s] [goog.net.XhrIo] Opening Xhr [GET http://thirdpartyserver.example.com/media_w941582493_4220444.aac -1]
media_player.js:25  [  7.387s] [goog.net.XhrIo] Will abort after 10000ms if incomplete, xhr2 false [GET http://thirdpartyserver.example.com/media_w941582493_4220444.aac -1]
media_player.js:25  [  7.392s] [goog.net.XhrIo] Sending request [GET http://thirdpartyserver.example.com/media_w941582493_4220444.aac -1]
media_player.js:51 Mixed Content: The page at 'https://example.com/custom_receiver.html?debug=true' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://thirdpartyserver.example.com/media_w941582493_4220444.aac'. This content should also be served over HTTPS.
media_player.js:25  [  7.515s] [goog.net.XhrIo] Request complete [GET http://thirdpartyserver.example.com/media_w941582493_4220444.aac 200]
media_player.js:25  [  7.521s] [cast.player.core.QualityManager] 0: current=1113553.96, average=1179706.05
media_player.js:25  [  7.528s] [cast.player.core.SegmentManager] 0: process segment
media_player.js:25  [  7.533s] [cast.player.hls.Adaptation] process segment

更新 - 更多信息:

第一个请求(playlist.m3u8)的响应标头如下:

Accept-Ranges:bytes
Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:Content-Type, User-Agent, If-Modified-Since, Cache-Control, Range
Access-Control-Allow-Methods:OPTIONS, GET, POST, HEAD
Access-Control-Allow-Origin:*
Access-Control-Expose-Headers:Date, Server, Content-Type, Content-Length
Cache-Control:no-cache
Content-Length:105
Content-Type:application/vnd.apple.mpegurl
Date:Tue, 21 Mar 2017 13:44:37 GMT
Server:WowzaStreamingEngine/4.5.0

第一个请求(playlist.m3u8)的响应正文如下:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=80053,CODECS="mp4a.40.2"
chunklist_w941582493.m3u8

第二个请求(chunklist_w941582493.m3u8)的响应标头如下:

Accept-Ranges:bytes
Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:Content-Type, User-Agent, If-Modified-Since, Cache-Control, Range
Access-Control-Allow-Methods:OPTIONS, GET, POST, HEAD
Access-Control-Allow-Origin:*
Access-Control-Expose-Headers:Date, Server, Content-Type, Content-Length
Cache-Control:no-cache
Content-Length:213
Content-Type:application/vnd.apple.mpegurl
Date:Tue, 21 Mar 2017 13:44:37 GMT
Server:WowzaStreamingEngine/4.5.0

第二个请求(chunklist_w941582493.m3u8)的响应正文如下:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:3
#EXT-X-MEDIA-SEQUENCE:4272014
#EXTINF:1.95,
media_w1552860397_4272014.aac
#EXTINF:2.09,
media_w1552860397_4272015.aac
#EXTINF:1.95,
media_w1552860397_4272016.aac

第二个请求(media_w941582493_4220443.aac)的响应标头如下:

Accept-Ranges:bytes
Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:Content-Type, User-Agent, If-Modified-Since, Cache-Control, Range
Access-Control-Allow-Methods:OPTIONS, GET, POST, HEAD
Access-Control-Allow-Origin:*
Access-Control-Expose-Headers:Date, Server, Content-Type, Content-Length
Cache-Control:no-cache
Content-Length:19757
Content-Type:audio/x-aac
Date:Tue, 21 Mar 2017 13:44:37 GMT
Server:WowzaStreamingEngine/4.5.0

1 个答案:

答案 0 :(得分:3)

正在搜索the bug tracker for the Google Cast SDK我找到了相关的bug report

我所要做的就是将cast.player.api.HlsSegmentFormat.MPEG_AUDIO_ES添加到cast.player.api.CreateHlsStreamingProtocol()。现在流工作正常,Cast设备不会崩溃或冻结。