我正在构建一个基于 [CAF SDK][1] 的自定义 Chromecast 接收器。我尝试将接收器应用程序设置为IDLE
状态模式,以便在媒体结束后的 5 分钟内处理启动画面……我尝试使用:
var video = document.createElement("video");
video.classList.add('castMediaElement');
video.style.setProperty('--splash-image', 'url("img/logo-mySplash.svg")');
document.body.appendChild(video);
var context = cast.framework.CastReceiverContext.getInstance();
context.setInactivityTimeout(300);
playerManager.addEventListener(cast.framework.events.EventType.ALL,
function (event) {
switch(event.type) {
case 'CLIP_ENDED':
context.setApplicationState('IDLE');
break;`
}
})
当媒体结束时,接收者调度:
{type: "CLIP_ENDED", currentMediaTime: 2673.986261, endedReason: "END_OF_STREAM"}
{type: "MEDIA_FINISHED", currentMediaTime: 2673.986261, endedReason: "END_OF_STREAM"}
并将错误发送到调试控制台:
[ 32.846s] [cast.receiver.MediaManager] Unexpected command, player is in IDLE state so the media session ID is not valid yet
我找不到有关此问题的任何文档。无论如何感谢您的回答。