javascript - Video source in conditional expressions -


i'd know how write condition includes video source parameter(i'm using html5 , javascript).

for instance, if video1 playing (or loaded) , user presses 'w' key video2 plays.

if(v.src=="video1.webm" && key_press=="z")         {             v.src="video2.webm";             v.play();         } 

but " v.src=='video1.webm' " doesn't seem work. how can use expression in condition?

thanks in advance!

you must reload before playing it, if update video source,

if (v.src=="video1.webm" && key_press=="z") {     v.src="video2.webm";     v.load();             v.play(); } 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -