我尝试在youtube视频上使用全屏模式,它在IE和Firefox上运行良好,但在Chrome上,它不是视频,而是全屏显示的网站。
我使用Zerif。
我尝试以下方式:
<div class="embed-responsive embed-responsive-16by9" style="margin:8px">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/bO2sbzgo4wQ" allowfullscreen></iframe>
</div>
和
<div class="embed-responsive embed-responsive-16by9" style="margin:8px">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/wCc2v7izk8w" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
和
<div class="embed-responsive embed-responsive-16by9" style="margin:8px">
<div id="ytplayer"></div>
<script>
// Load the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// Replace the 'ytplayer' element with an <iframe> and
// YouTube player after the API code downloads.
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('ytplayer', {
height: '390',
width: '640',
videoId: 'M7lc1UVf-VE'
});
}
</script>
</div>
我也尝试使用<object>
,但每当它在IE和Firefox上工作时,Chrome就会在网站上全屏显示。
对不起我的英文并感谢您的帮助。