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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -