缓冲后出现Caf chromecast MPEG DASH错误

时间:2019-02-13 10:02:54

标签: javascript casting chromecast mpeg-dash

我无法使用chromecast播放完整的MPEG DASH。投射从IOS或Android发送者开始,但是在缓冲后无法恢复并且连接结束。

如果我们看一下调试器,则没有错误。我们只能看到buffering = true。几秒钟后,Chromecast无法播放。

调试器:

ll {type: "MEDIA_STATUS", mediaStatus: {…}}
[Violation] 'setTimeout' handler took 376ms
[Violation] 'setTimeout' handler took 914ms
[Violation] 'setTimeout' handler took 60ms
index2.html:35 sl {type: "BUFFERING", isBuffering: true}
[Violation] 'setTimeout' handler took 1023ms
cast_receiver_framework.js:29 [Violation] 'timeupdate' handler took 306ms
index2.html:35 jl {type: "RATE_CHANGE", currentMediaTime: 255.119044}
[Violation] 'setTimeout' handler took 82ms
index2.html:35 ll {type: "MEDIA_STATUS", mediaStatus: {…}}

任何具有或不具有DRM的DASH或平滑流视频都会发生这种情况。

接收方代码:

<html>
<head>
</head>
<body>
  <cast-media-player id="player"></cast-media-player>
  <script type="text/javascript" src="//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js">
  </script>
  <script>
    const context = cast.framework.CastReceiverContext.getInstance();
    const playerManager = context.getPlayerManager();

    // intercept the LOAD request to be able to read in a contentId and get data
    playerManager.setMessageInterceptor(
        cast.framework.messages.MessageType.LOAD, loadRequestData => {
            if (loadRequestData.media && loadRequestData.media.contentId) {
                     //loadRequestData.media.contentUrl = media.url;
                    //loadRequestData.media.contentType = media.contentType;
                    //loadRequestData.media.metadata = media.metadata;
                                        loadRequestData.media.contentUrl = "https://dash.akamaized.net/dash264/TestCases/1c/qualcomm/2/MultiRate.mpd";
                    loadRequestData.media.contentType = "application/dash+xml";

                  return loadRequestData;
                }
            });
                        
    // listen to all Core Events
    playerManager.addEventListener(cast.framework.events.category.CORE,
        event => {
            console.log(event);
        });

    const playbackConfig = new cast.framework.PlaybackConfig();

    playbackConfig.autoResumeDuration = 5;
        playbackConfig.autoResumeNumberOfSegments = 5;
        playbackConfig.enableSmoothLiveRefresh = 1;

    context.start({
      playbackConfig: playbackConfig,
    });
  </script>
</body>
</html>

有人有类似的行为吗? chromecast上的Dash播放正常吗? 接收者代码正确吗?

0 个答案:

没有答案