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


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

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('Playing "' + item.sources[0].file + '" (type ' + item.sources[0].type + ')');

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:

Any help appreciated!


1 Community Answers


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.