Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

set jwplayer file src dynamically


Hi , I m using JW player 7.7.4. I need to change the file attribute value dynamically on java script click. How can we achieve this ? Please help.

I tried doing this on click event :

1. jwplayer('playerid').file="video.mp4";
2. jwplayer('playerid').load("video.mp4");

Both did not work for me.

Thanks in advanced.



4 Community Answers

h...

User  
0 rated :

correction JW Player 7.4.4 :P

Alex

JW Player Support Agent  
0 rated :

Hi there,

If you would need to load “video.mp4” programatically, you would need this call:

jwplayer('playerid').load([{'file': 'video.mp4'}]);

For more information, please see the entry for .load() on our JavaScript API Reference.

Thank you.

h...

User  
0 rated :

Thanks.

It worked for me.

Alex

JW Player Support Agent  
0 rated :

Not a problem!

This question has received the maximum number of answers.