【发布时间】:2014-04-26 16:30:31
【问题描述】:
我想使用 Chromecast 显示网页。目前该页面非常简单(只是“Hello World!”),但我希望使其更复杂,并可能与第二个屏幕交互。但是,我发现如果我不创建媒体管理器 (new cast.receiver.MediaManager(window.mediaElement)),会话会立即在我的发件人上过期(调用 function sessionUpdateListener(false))。该页面仍会显示,但我无法再与之交互,包括停止应用程序。
我想知道这是设计使然、错误还是我做错了什么?
这是我的自定义接收器的代码...
<html>
<head>
<title>Hello World Chromecast App</title>
<style type="text/css">
*
{
color: white;
}
</style>
</head>
<body>
<div>Hello World!</div>
<script src="//www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js"></script>
<script type="text/javascript">
window.onload = function () {
window.castReceiverManager = cast.receiver.CastReceiverManager.getInstance();
window.castReceiverManager.start();
}
</script>
</body>
</html>
【问题讨论】: