Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

Dynamically Load Video's

$
0
0

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


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>