2016-10-30 3 views
0

私はいくつかのボタンを使ってインタラクティブなビデオをいくつかの要素にリンクしていますが、この要素はフルスクリーンの中で最高のショーです。コードを(もし可能なら)統合するソリューションを探しています。サイト、ビデオは自動的にフルスクリーンされます。これは可能ですか?フルスクリーンビデオを開くには?

<div style="position: relative; padding-bottom: 56.25%; "><iframe style="position: absolute; top: 0; left: 0;" frameborder="0" allowfullscreen scrolling="no" style="width: 1px; min-width: 100%; *width: 100%;" height="100%" src="https://playfilmstorage.blob.core.windows.net/media/published/398548bd-4bc9-42cf-ab5e-bd6a922afbf0/index.html?autoplay=false"></iframe></div> 
+1

フルスクリーンを自動的に行うことはできませんそれをトリガするユーザイベント – charlietfl

答えて

0

これを試してみてください:
はJavaScriptを使用して解決策があります。 MozillaとWebkitのブラウザで動作しています。

あなたがelement.mozRequestFullScreen();element.webkitRequestFullScreen();

例使用することができます。要素のためのフルスクリーンモードを許可するには

function goFullscreen(id) { 
    var element = document.getElementById(id); 

    if (element.mozRequestFullScreen) { 
     element.mozRequestFullScreen(); 
    } else if (element.webkitRequestFullScreen) { 
     element.webkitRequestFullScreen(); 
    } 
} 
<img class="video_player" src="image.jpg" id="player"></img> 
<button onclick="goFullscreen('player'); return false">Fullscreen</button> 

を、あなたはallowFullScreenであなたのiframeを設定する必要があります。

<iframe src="iframe.html" width="100" height="100" allowFullScreen></iframe> 
関連する問題