1 Reply Latest reply on Oct 31, 2013 2:16 PM by kglad

    SWFObject - 2 Videos on same page



      i have two videos on my page (#video_one, #video_two), each of these videos has a .mp4 and a .webm video file. In order to make the video work I use SWFObject as a fallback solution. I did it in the past a dozen times and it worked fine for a single video on the page.


      I now have two videos and asking myself why this code is not working. Does anyone know how i can include SWFObject properly for two videos on my webpage?


      Any help is much appreciated! Thanks.


      <video id="video_one" controls="controls" loop="loop">

      <source src="inc/1.mp4" type="video/mp4">

      <source src="inc/1.webm" type="video/webm">              


      <video id="video_two" controls="controls" loop="loop">

      <source src="inc/2.mp4" type="video/mp4">

      <source src="inc/2.webm" type="video/webm">              



      <script type="text/javascript">

                            $(document).ready(function() {


                              var v = document.createElement("video");

                              if ( !v.play ) {

      //number one

                                              var h264_o = "1.mp4";

                                              var folder_o ="inc/";


                                              var flashvars_o = {autoplay:true,loop:true,controls:true,src:escape(folder_o+h264_o)};

                                              var params_o = {allowFullScreen:false,wmode:"opaque"};

                                              var attributes_o = {bgcolor:"#000000"};


                                              swfobject.embedSWF("flashfox.swf", "video_one", "640", "360", "9.0.0","", flashvars_o, params_o, attributes_o);

      //number two

                      var h264_t = "2.mp4";

                      var folder_t ="inc/";


                      var flashvars_t = {autoplay:true,loop:true,controls:true,src:escape(folder_t+h264_t)};

                      var params_t = {allowFullScreen:false,wmode:"opaque"};

                      var attributes_t = {bgcolor:"#000000"};


                      swfobject.embedSWF("flashfox.swf", "video_two", "640", "360", "9.0.0","", flashvars_t, params_t, attributes_t);