防止divx web插件替换html5视频元素? [英] Prevent divx web plugin fron replacing html5 video element?

查看:215
本文介绍了防止divx web插件替换html5视频元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于某种原因,我确信DivX的人认为很重要,没有直接的方法可以防止他们的插件用他们喜欢的徽标替换页面上的所有视频元素。

For some reason I'm sure the folks at DivX think is important, there is no straightforward way to prevent their plugin from replacing all video elements on your page with they fancy logo.

我需要的是一个解决方法,告诉插件跳过一些视频,即不用他们的可播放内容替换它们。

What I need is a workaround for this, telling the plugin to skip some videos, i.e. not replace them with their playable content.

推荐答案

我通过放置一个空的HTML 5视频标签,然后在body onload事件中的JavaScript函数中放入视频源标签来解决这个问题。然后该视频出现在普通的HTML 5播放器而不是DivX网络播放器中。

I got around this by putting an empty HTML 5 video tag, then putting in the video source tags in a JavaScript function in the body onload event. The video then comes up in the normal HTML 5 player and not the DivX web player.

例如。
这将给DivX播放器:

e.g. This would give the DivX player:

<video width="320" height="240" controls="controls">
  <source src="movie.mp4" type="video/mp4" />
</video>

但这会给普通的html 5玩家:

But this would give the normal html 5 player:

    <head>
    <script type="text/javascript">
    function changevid() {
       document.getElementById('vid').innerHTML = '<source src="inc/videos/sample1.mp4" type="video/mp4" />';
       document.getElementById('vid').load();
    }
    </script>
    </head>
    <body onload="changevid()">

       <video id="vid" width="800" height="450" controls="controls">    
       </video>

    </body>

这篇关于防止divx web插件替换html5视频元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆