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>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章