html5-videodivx

Prevent divx web plugin fron replacing html5 video element?


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.


Solution

  • 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.

    e.g. This would give the DivX player:

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

    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>