投射音频流时,投射设备冻结 [英] Cast devices freeze when casting audio streams

查看:61
本文介绍了投射音频流时,投射设备冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

投放第三方音频流时出现问题。我非常依赖 https://developers.google.com/cast/docs/player并遵循有关如何创建自定义接收器以播放流的说明。

I have an issue with casting some third party audio streams. I have relied heavily on https://developers.google.com/cast/docs/player and followed those instructions on how to create a custom receiver for playing the streams.

在启动流后仅一秒钟左右(我什么也没得到声音),Cast设备冻结,并且它们停止通过Chrome响应调试,并且对停止Cast会话没有反应。通常情况下,它们是如此锁定,以至于无法通过Home应用发布重新启动功能;我必须物理断开电源。

After just a second or so after starting the stream (I don't get any sound) the Cast devices freezes and they stop responding to debug via Chrome and they don't react to stopping the Cast session. Often they are so locked that even issuing a reboot via the Home app doesn't work; I have to physically disconnect the power.

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

It's the same behaviour on Chromecast v2 (1.22.79313), Chromecast Ultra (1.22.78017) and Google Home (1.22.78295).

冻结的原因是什么?这是由一些非常中断的流引起的吗?这是一个已知问题吗?有什么解决方法吗?

这是我从Chrome浏览器中获得的日志,难道不应该让Cast设备处理此问题并给出一些错误消息而不会像这样崩溃吗?重置连接之前的开发人员工具:

This is the log I get from the Chrome Developer Tools before the connection is reset:

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 )的响应主体为

The response body for that first request (playlist.m3u8) is as follows:

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

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

The response headers for that second request (chunklist_w941582493.m3u8) are as follows:

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 )典型如下:

The response body for that second request (chunklist_w941582493.m3u8) is typical something as follows:

#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 )如下:

The response headers for that second request (media_w941582493_4220443.aac) are as follows:

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


推荐答案

搜索 Google Cast SDK的错误跟踪器我找到了相关的错误报告

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

All I had to do was to add cast.player.api.HlsSegmentFormat.MPEG_AUDIO_ES to cast.player.api.CreateHlsStreamingProtocol(). Now the stream works just fine and the Cast devices don't crash or freeze.

这篇关于投射音频流时,投射设备冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆