这是整页
<html>
<head>
<script type="text/javascript" src="//bitmovin-a.akamaihd.net/bitdash/latest/bitdash.min.js"></script>
</head>
<body>
<div id="player"></div>
<script type="text/javascript">
var conf = {
key: "xxxxxxx",
playback: {
autoplay: true
},
source: {
dash: 'http://xxxxxx',
poster: 'https://i.ytimg.com/vi/y5qYUsmZNHg/maxresdefault.jpg'
}
};
var player = bitdash('player');
if (player.requestFullscreen) {
player.requestFullscreen(); }
player.setup(conf).then(function(value) {
// Success
console.log('Successfully created bitdash player instance');
}, function(reason) {
// Error!
console.log('Error while creating bitdash player instance');
});
</script>
</body>
</html>
我使用简单的iframe嵌入代码,甚至在其中添加allowfullscreen 但是每当我尝试通过浏览器全屏显示它时,它都会返回错误
“全屏请求被拒绝,因为至少有一个包含iframe的文档没有”allowfullscreen“属性。”
我不熟悉JS或HTML,所以这可能是我的愚蠢。我添加了if语句,但没有修复它,所以我在这里丢失了。