在Edge中禁用视频自动播放并在IE中禁用下载

时间:2019-03-30 13:25:51

标签: html5 internet-explorer video microsoft-edge

客户希望在不禁用自动播放的情况下播放视频,尽管我进行了更改,但我们在Edge和IE上遇到了问题。

  • 在Edge中自动播放视频
  • 在Internet Explorer中,它会提示您下载mp4文件,但即使在设置中禁用了下载视频,也不会显示视频。

我已更改代码以强制禁用自动播放功能,但这仅在Firefox和Chrome中可以正常使用

JQuery:

obj_adjustments.removeAutoplay = function() {
    var $iframe = $("iframe");        

    $iframe.on("load", function () {
        var $iframeContents = $iframe.contents();

        $iframeContents.find("video").removeAttr("autoplay");  
    });      
}

和HTML:

<iframe frameborder="0" height="720" scrolling="no" 
    src="Video.mp4" 
    width="1280" style="height: 832px;">
<html>
<head>
    <meta name="viewport" content="width=device-width">
</head>
<body>
    <video 
        controls="" name="media"><source src="Video.mp4" 
        type="video/mp4">
    </video>
</body>
</html>
</iframe>

对于IE-强制禁用下载/强制播放视频

对于Edge-禁用自动播放

0 个答案:

没有答案