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

Refresh RSS Playlist


Hi!

I'm looking to get an embedded player to always play the latest videos from an RSS feed. So if the RSS feed content has updated, I want the playlist to update.

The basic way to do this is a META refresh on the page, but hoping for a neater solution.

I thought I might be able to set a timeout in javascript to either reload the player, or get it to load the playlist again. I tried this but it just causes a "No playable sources found" error;

jwplayer("player).load({playlist:"/the/url/rss"});

The playlist url is the same one used in the .setup so I know it's okay.


Any tips?

Thanks!

7 Community Answers

Cooper Reid

JW Player Support Agent  
0 rated :

Can you try doing:

jwplayer(“player).load(”/the/url/rss");

-Cooper

jamesw

User  
0 rated :

Hi Cooper.

Getting strange results. Here is an exert of what I have;

<div class='jwplayer' id='jwplayer-0'></div>

<script type='text/javascript'>if(typeof(jQuery)=="function"){(function($){$.fn.fitVids=function(){}})(jQuery)};jwplayer('jwplayer-0').setup({"aspectratio":"4:3","width":"100%","autostart":true,"mute":true,"primary":"html5","repeat":true,"playlist":"first/url/here"});
</script>

<div class='jwplayer' id='jwplayer-1'></div>

<script type='text/javascript'>if(typeof(jQuery)=="function"){(function($){$.fn.fitVids=function(){}})(jQuery)};jwplayer('jwplayer-1').setup({"aspectratio":"4:3","width":"100%","autostart":true,"mute":true,"primary":"html5","repeat":true,"playlist":"second/url/here"});
</script>

<script type='text/javascript'>
setTimeout("refreshPL()",10000);

function refreshPL() {
jwplayer("jwplayer-0").load("first/url/here");
jwplayer("jwplayer-0").play(true);
jwplayer("jwplayer-1").load("second/url/here");
jwplayer("jwplayer-1").play(true);

setTimeout("refreshPL()",40000);
}
</script>


When refreshPL() runs both players load the playlist but only one starts playing but a few seconds into the first video. I can click play and get them going again but I don't want that to be necessary. If I remove that refresh function the players work as expected, looping the playlists.

Thanks

Cooper Reid

JW Player Support Agent  
0 rated :

You may not need to call .play() after you call load. Also, I recommend writing your setTimeout calls like this:
setTimeout(refreshPL, 40000);
-Cooper

jamesw

User  
0 rated :

Having made those changes I now get the error;

Uncaught TypeError: jwplayer(...).load is not a function

---

<script type='text/javascript'>
setTimeout(refreshPL(),10000);

function refreshPL() {
jwplayer("jwplayer-0").load("/rss/url/");
// jwplayer("jwplayer-0").play(true);
jwplayer("jwplayer-1").load("/rss/url2/");
// jwplayer("jwplayer-1").play(true);

setTimeout(refreshPL(),40000);
}
</script>

Cooper Reid

JW Player Support Agent  
0 rated :

You still need to setup your player before you begin binding events and calling .load on it:
jwplayer(“jwplayer-0”).setup({
file: ‘bunny.mp4’,
title: ‘Bunny’,
image: ‘bunny.jpg’,
width:‘100%’
});

//the rest of your code

-Cooper

jamesw

User  
0 rated :

Yes, I was implying I left the .setup lines in there.

Never mind, thanks for trying.

Cooper Reid

JW Player Support Agent  
0 rated :

Can you please provide a link so we can troubleshoot your issue?

Regards,
Cooper

This question has received the maximum number of answers.