0 Replies Latest reply on Jun 30, 2013 2:26 PM by nat1979nov.

    Dynamically Load Video's

    nat1979nov.

      Hi Guys,

       

      So i have a simple composition with a video playing on autoplay and loop using this code

       

      var vid=sym.$("vidBox");

       

       

      vid.html('<video width= "977" height= "721" src= "1_1_1.mp4"  type= "video/mp4" loop= "loop" autoplay="autoplay"</video>');

       

      i want to add a button that when clicked will swap out the video for another and if they keep pressing the button it will just go through the 8 videos i have.

       

      i'm guessing this is doable using jquery something like,

       

      $("#vidBox").empty().append( video width= "977" height= "721" src= "2.mp4"  type= "video/mp4" loop= "loop" autoplay="autoplay" );

      $("#vidBox").empty().append( video width= "977" height= "721" src= "3.mp4"  type= "video/mp4" loop= "loop" autoplay="autoplay" );

      $("#vidBox").empty().append( video width= "977" height= "721" src= "4.mp4"  type= "video/mp4" loop= "loop" autoplay="autoplay" );

      etc etc etc

       

      but i'm really a novice at this so any help would be great!

       

      thanks

       

      Nat