I'm trying to get the URL of the video via jwplayer().getPlaylistItem().file;
onComplete callback, but it's returning nothing.
jwplayer().onComplete(function(e) {
var videoURL = this.getPlaylistItem().file;
console.log('Completed = ' + videoURL);
});
It should be this:
var videoURL = jwplayer().getPlaylistItem()['file'];
Your code seems to work.
jwplayer("container").setup({
playlist: "http://content.jwplatform.com/feeds/13ShtP5m.rss",
displaytitle: false,
width: 640,
height: 360
});
jwplayer().onComplete(function(e) {
var videoURL = this.getPlaylistItem().file;
console.log('Completed = ' + videoURL);
});
See this example:
http://jsfiddle.net/rDs4P/
If it still doesn't work, please provide link where you run the player.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With