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

Cannot load rss feed into player


I'm having trouble loading an RSS feed into jwplayer. The code was working on an earlier version of jwplayer (can't recall which probably around v6.4), and after upgrading to v6.8 it no longer works.

The RSS feed I'm trying to load: http://content.bitsontherun.com/jw6/WXhR8pkN.xml which translates into

bc.. jwplayer.load('http://content.bitsontherun.com/jw6/WXhR8pkN.xml');



I added a console.log() statement in jwplayer.js to see what was going on. Here's the error message (running on a local server):

bc.. There was an error calling back an event handler jwplayer.js:4
TypeError: Cannot read property 'sources' of undefined
at x (http://p.jwpcdn.com/6/8/jwpsrv.js:6:51)
at null.<anonymous> (http://p.jwpcdn.com/6/8/jwpsrv.js:8:466)
at j.dispatchEvent (http://192.168.150.141:8080/js/330b5eda8cadbf07bf1f/vendor/jwplayer-6.8/jwplayer.js:92:74)
at j.playerReady (http://192.168.150.141:8080/js/330b5eda8cadbf07bf1f/vendor/jwplayer-6.8/jwplayer.js:92:509)
at Function.e.playerReady (http://192.168.150.141:8080/js/330b5eda8cadbf07bf1f/vendor/jwplayer-6.8/jwplayer.js:94:451)
at <anonymous>:1:31 jwplayer.js:4

10 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Where is this running?

JW Player

User  
0 rated :

We're currently using YouTube videos (via jwplayer) on the site but would like to use jwplayer's platform to also host videos. I don't have a version with the bug that's live unfortunately.

We're self hosting the player. Here's a current working version:
https://tunessence.com/tabs/nirvana/in-bloom

Click on the lesson button.

The only change between the working app and the non-working one is:
bc.. // Working
jwplayer.load([{file: 'https://www.youtube.com/watch?v=eONzZj2pjw4')}]);
// Not working
jwplayer.load('http://content.bitsontherun.com/jw6/WXhR8pkN.xml');

Ethan Feldman

JW Player Support Agent  
0 rated :

What about using:

jwplayer.load([{playlist: 'http://content.bitsontherun.com/jw6/WXhR8pkN.xml')}]);

JW Player

User  
0 rated :

That doesn't work unfortunately. It gives the same error message as above, plus:
bc.. jwplayerError: Playlist could not be loaded: No playable sources found



It looks like the error might be in the analytics plugin being loaded as jwpsrv.js. I've disabled the analytics with
bc.. analytics : {enabled: false, cookies: false},



Any idea why it's still being loaded?

JW Player

User  
0 rated :

So the problem has nothing to do with the RSS feed. Instead, there's a problem with quickly loading and then playing a video hosted on jwplatform. Our code does the following:

bc.. jwplayer().load('https://content.bitsontherun.com/jw6/WXhR8pkN.xml');
jwplayer().onPlaylist(function () {
jwplayer().play():
});



While this works for YouTube videos, it fails for those videos hosted on jwplatform. I got it working with a hack by using setTimeout() and playing after a fixed amount of time. That solution isn't great as it's masking the real problem.

Here's a test case you guys can use:

bc.. // Go to: https://tunessence.com/tabs/red-hot-chili-peppers/snow
// Click on show lesson
// Open the console
// Paste the following:
jwplayer().load('https://content.bitsontherun.com/jw6/WXhR8pkN.xml');
jwplayer().play();

// Notice how it doesn't play. Even if you wait for the onPlaylist event like:
jwplayer().load('http://content.bitsontherun.com/jw6/WXhR8pkN.xml');
jwplayer().onPlaylist( function() {
jwplayer().play();
});

// It doesn't work. However, if you use a setTimeout(), it works:
jwplayer().load('https://content.bitsontherun.com/jw6/WXhR8pkN.xml');
setTimeout(function() {
jwplayer().play();
}, 500);



Any insight into this would be great. There's also a bug with the analytics plugin that I mentioned above, but I don't think that's the core issue.

Ethan Feldman

JW Player Support Agent  
0 rated :

This should work:

jwplayer().load("https://content.bitsontherun.com/jw6/WXhR8pkN.xml");
jwplayer().onPlaylistItem(function(){jwplayer().play();});

JW Player

User  
0 rated :

That still doesn't work. I was mistaken above, the actual order we call it is onPlaylist() first and then load(), as you have to set the event handler first. So I ran your code as follows:

bc.. // Go to: https://tunessence.com/tabs/red-hot-chili-peppers/snow
// Click on show lesson
// Open the console
// Paste the following:
jwplayer().onPlaylistItem(function(){jwplayer().play();});
jwplayer().load("https://content.bitsontherun.com/jw6/WXhR8pkN.xml");



The video loads, but it won't start playing. At least on Chrome 33.0.1750.154 / Win 7 and Firefox 28.0 / Win 7.

A couple other issues I found.

1. Switching from a YouTube video to a jwplatform video gives a 404:
bc.. GET https://i1.ytimg.com/vi/https%3A//content.bitsontherun.com/manifests/WXhR8pkN.smil/hqdefault.jpg 404 (Not Found) i1.ytimg.com/vi/https%3A//content.bitsontherun.com/manifests/WXhR8pkN.smil/hqdefault.jpg:1


It's trying to get a youtube thumbnail from a jwplatform video.

2. According to the docs, onPlaylistItem() should have playlist as an event attribute. It does not, instead it has a "type" field that has the value of "jwplayerPlaylistItem"

Ethan Feldman

JW Player Support Agent  
0 rated :

I have a page that does this using our platform, email me for a link – http://www.jwplayer.com/contact-us/

JW Player

User  
0 rated :

Thanks Ethan, onPlaylistItem() did the trick.

Ethan Feldman

JW Player Support Agent  
0 rated :

Np

This question has received the maximum number of answers.