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

Change video using javascript

Hi, how can i do ...Hi, how can i do to change the video using javascript and not reload the page...

for example if I have a pointer to my player:

player = document.getElementById('myPlayer'); //javascript line

how can I change the video to be played ?
Maybe something like this ?
player.file = "new_video.flv" ; //other javascript line

Please if you have some info let me know writing to

Thanks a lot in advance,

4 Community Answers

JW Player

0 rated :

See the JW FLV Player API documentation here: **

JW Player

1 rated :

Javier, pudiste solucionarlo?

JW Player

0 rated :


You can simple send load event to the player.
Like this:

player = document.getElementById('myPlayer');
player.sendEvent('LOAD', '');

JW Player

0 rated :

I'd like to take this a step further...

I have a pre-recorded "place" file that I'd like to play that shows our company logo and plays some music and loops over and over.

I'd like to use AJAX to check for the availability of a live stream via Flash Live Media Encoder and when the event turns on, send the URL of that live event to the player.

When the live event ends, I'd like for the place file to be played and then loop.

I have an idea of how to implement it but if somebody has already done this, that would be even where credit is due... :)

For an example, if anybody that reads this subscribes to some sports packages, they do this: they play the logo of the service with some music and then break into the live event when it happens and back into the logo when the event ends.

This question has received the maximum number of answers.