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

JW6: How to output currently played video


Hi

I want to output information about the player and the currently played video. I have written the following code for JW player 6:

<code>
jwplayer().onReady(function(e) {
console.log('JW Player v' + jwplayer().version + ' loaded (' + jwplayer().getRenderingMode() + ' mode)');
jwplayer().onPlay(function(e) {
var item = jwplayer().getPlaylistItem();
console.log(item);
console.log('Playing "' + item.sources[0].file + '" (type ' + item.sources[0].type + ')');
});
</code>

My problems are

1) jwplayer().version outputs undefined even though I can see the version number with a Javascript debugger
2) If I have multiple sources e.g. for SD/HD how do I know which one is played? item.file seems always to be set to item.sources[0].file and there is no property within the item object with an index to the sources-Array.

URL of demo: http://www.uni-muenster.de/videoportal/video/50_Jahre_ZIV.html

Any help appreciated!

Regards
Thorsten

1 Community Answers

Todd

JW Player Support Agent  
0 rated :

I usually use jwplayer().getPlaylistItem().file to get the video URL that the player has loaded via Javascript.

This question has received the maximum number of answers.