0

I am using this code for embedding a video on my website (which I believe is best SEO practice). It is running a little slow on IE & Firefox. I have added the javascript (found on Stack) to make the play, pause, volume, fullscreen option display. I'm worried the javascript will slow down the page. Can I get confirmation that this is the best way to do this or offer another option?

<head>
<!--Video.js | HTML5 Video Player -->
<link href="//vjs.zencdn.net/3.2/video-js.css" rel="stylesheet" type="text/css">
<script src="http://vjs.zencdn.net/3.2/video.js"></script>
<script>
        _V_.options.flash.swf = "video-js.swf";
</script>
<script>    
        _V_("example_video_1").ready(function(){   
            var myPlayer = this;
        }); 
</script>
</head>
<body>
<video id="video_1" class="video-js vjs-default-skin" controls width="480" height="204" autoplay preload="auto" poster="/images/Buy-Mexpro.jpg">
    <source src="/videos/Mexpro-1Min-HDvideo.mp4" type="video/mp4" />
    <source src="/videos/Mex_Pro_1_Minute_spot-HD.webm" type="video/webm" />
    <source src="/videos/Mex_Pro_1_Minute_spot-HD.webm.ogv" type="video/ogg" />
    <object id="videocontainer-object">
        <param name="movie" value="http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf"></param>
        <param name="flashvars" value="/videos/Mexpro-1Min-HDvideo.mp4&amp;playButtonOverlay=false&amp;loop=true&amp;autoPlay=true&amp;controlBarMode=none"></param>
        <param name="allowFullScreen" value="false"></param>
        <param name="allowscriptaccess" value="always"></param>
        <embed id="videocontainer-embed" src="http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="1280" height="720" flashvars="src=http://homepage.de/video/BigWeb.mp4&amp;controlBarMode=none&amp;playButtonOverlay=false&amp;loop=true&amp;autoPlay=true"></embed>
    <input type="button" value="Pause" onClick="myPlayer.pause();">
    <input type="button" value="Play" onClick="myPlayer.play();">
    </object>
</video>
</body>
user973542
  • 79
  • 3
  • 11

1 Answers1

0

You are using a very old version of video.js. If you use it, you should use the current version:

<link href="//vjs.zencdn.net/5.8/video-js.css" rel="stylesheet">
<script src="//vjs.zencdn.net/5.8/video.js"></script>

<video id="video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="268" data-setup='{}' poster="/images/Buy-Mexpro.jpg">
  <source src="/videos/Mexpro-1Min-HDvideo.mp4" type="video/mp4" />
  <source src="/videos/Mex_Pro_1_Minute_spot-HD.webm" type="video/webm" />
  <source src="/videos/Mex_Pro_1_Minute_spot-HD.webm.ogv" type="video/ogg" />
</video>

The embedded object isn't and was never necessary for video.js's Flash tech to be used as fallback.

misterben
  • 7,455
  • 2
  • 26
  • 47