iframe不能全屏

The full screen option, especially over the iframe embed code, can be difficult to get working depending on your site architecture. This is partially why we recommend the JS code.

If you need to use the iframe embed, though, and the full screen button is either missing or not working there are solutions.

The first is to look at your source code to see if you can find any iframes directly above the DaCast embed code. An "iframe within an iframe". Here is an example of this:

 

<iframe name="IFrame_i1cbhqkm" id="IFrame_i1cbhqkm" width="588" height="347" src="http://www.mywebsite.com/html/b32b8d.html">
<html>
<head></head>
<body>
<iframe src="https://iframe.dacast.com/b/888/c/9999" width="576" height="324" frameborder="0" scrolling="no" allowfullscreen="" webkitallowfullscreen="" mozallowfullscreen="" oallowfullscreen="" msallowfullscreen=""></iframe>
</body>
</html>
</iframe>

The issue caused here is that the "parent" iframe is blocking the content from going full screen. So the iframe within, in this case the DaCast player, is also blocked.

The solution is to allow the parent iframe to go full screen. You can do this by adding the following to the code:

allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" oallowfullscreen="true" msallowfullscreen="true" 

 

Using the above example, here is a version that will work with the full screen option:

<iframe name="IFrame_i1cbhqkm" id="IFrame_i1cbhqkm" width="588" height="347" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" oallowfullscreen="true" msallowfullscreen="true" src="http://www.mywebsite.com/html/b32b8d.html">
<html>
<head></head>
<body>
<iframe src="https://iframe.dacast.com/b/888/c/9999" width="576" height="324" frameborder="0" scrolling="no" allowfullscreen="" webkitallowfullscreen="" mozallowfullscreen="" oallowfullscreen="" msallowfullscreen=""></iframe>
</body>
</html>
</iframe>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值