【发布时间】:2018-02-22 14:26:12
【问题描述】:
我们发现当有多个嵌入 Chromecast 插件的播放器可用时,Chromecast 插件无法注册两个投射按钮。
可见的控制台错误是: 未捕获的 DOMException:无法在“文档”上执行“registerElement”:“google-cast-button”类型的注册失败。已注册具有该名称的类型。
似乎演员框架正在将第二个按钮的 css 属性更改为 display:none 一旦有其他玩家使用它。
表示错误的测试页面:https://jsbin.com/repivowuge/edit?html,js,output
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<h2>Chromecast 'google-cast-button' error, toggle browser console to see</h2>
<h3>Player 1</h3>
<script src="https://cdnapisec.kaltura.com/p/1673641/sp/167364100/embedIframeJs/uiconf_id/41860021/partner_id/1673641"></script>
<div id="kaltura_player_1519307906" style="width: 560px; height: 395px;"></div>
<script>
kWidget.embed({
"targetId": "kaltura_player_1519307906",
"wid": "_1673641",
"uiconf_id": 41860021,
"flashvars": {
"streamerType": "auto",
"chromecast.plugin": true
},
"cache_st": 1519307906,
"entry_id": "1_4bc211jv"
});
</script>
<h3>Player 2</h3>
<div id="kaltura_player_1519307903" style="width: 560px; height: 395px;"></div>
<script>
kWidget.embed({
"targetId": "kaltura_player_1519307903",
"wid": "_1673641",
"uiconf_id": 41860021,
"flashvars": {
"streamerType": "auto",
"chromecast.plugin": true
},
"cache_st": 1519307906,
"entry_id": "1_4bc211jv"
});
</script>
</body>
</html>
【问题讨论】: