RSS feeds can be used to load playlists with multiple pieces of content into JW Player 6, but also to load multiple media formats and/or multiple quality levels for each piece of content.
JW Player requires the RSS feed to be valid and using the JWPlayer RSS namespace (preferred), the Media RSS namespace or vanilla RSS 2.0. All item and source attributes are supported with JWPlayer RSS, but not with Media RSS and definitely not with plain RSS.
JW Player supports two mechanisms for loading playlists:
See Working with Playlists for info on loading playlists inline, plus info on the structure of playlists in JW Player 6.
Whichever option is the best depends upon your setup. Inline JSON configurations allow JW Player to load content faster (no extra file to load) and avoid any crossdomain loading issues. A crossdomain loading issue appears if your player is embedded at www.example.com and your RSS feed is loaded from www.othersite.com (or subdomain.example.com). By default, this is not allowed by any browser, in both Flash and HTML5 mode. See Crossdomain File Loading for more info and workarounds.
External RSS feeds are useful for larger scale media deployments, where separation of presentation (inline config options) and content (RSS feed) is preferred. External RSS is also useful when working with third-party content providers, directly loading the RSS feeds off their servers (e.g. for podcasts).
Here's an example jwplayer().setup() block that configures a player to load an RSS feed. Since the feed contains both file, title and image, only a single option is needed:
jwplayer("myElement").setup({
playlist: "http://example.com/playlist.rss"
});
Here's the RSS feed of this example (with just one video to keep things short), using the JW Player extension:
<rss version="2.0" xmlns:jwplayer="http://rss.jwpcdn.com/">
<channel>
<item>
<title>Sintel Trailer</title>
<description>Sintel is a fantasy CGI from the Blender Open Movie Project.</description>
<jwplayer:image>/assets/sintel.jpg</jwplayer:image>
<jwplayer:source file="/assets/sintel.mp4" />
</item>
</channel>
</rss>
When authoring RSS feeds with JWPlayer or Media extensions, do not forget to add the xmlns:jwplayer or xmlns:media namespace to the top XML element. Otherwise, JW Player won't be able to parse the feed.
Below is how all playlist item properties map to JWPlayer RSS, Media RSS and vanilla RSS. As you can see, not all properties (though most) are supported with Media RSS. This means that the JWPlayer and Media extensions are equally fine for basic setups, but JWPlayer must be used when setting features like source labels or text tracks. Plain RSS only provides very basic coverage and is really only useful for playing podcasts from third-party RSS providers.
| Inline Playlist | RSS with JWPlayer | RSS with Media | vanilla RSS |
|---|---|---|---|
| title | title | title | title |
| description | description | description | description |
| mediaid | guid | guid | guid |
| image | jwplayer:image | media:thumbnail@url | - |
| source.file | jwplayer:source@file | media:content@url | enclosure@url |
| source.label | jwplayer:source@label | - | - |
| source.default | jwplayer:source@default | - | - |
| source.type | jwplayer:source@type | media:content@type | enclosure@type |
| track.file | jwplayer:track@file | media:subtitle@url | - |
| track.kind | jwplayer:track@kind | - | - |
| track.label | jwplayer:track@label | - | - |
| track.default | jwplayer:track@default | - | - |
See Supported Media Formats to find out which mimetypes should be used for which media formats.
Having multiple sources and tracks per RSS item is possible with both JWPlayer and Media namespaces. Here is an example feed (using JWPlayer) with one item that has two MP4 video qualities and two VTT caption tracks:
<rss version="2.0" xmlns:jwplayer="http://rss.jwpcdn.com/">
<channel>
<item>
<title>Sintel Trailer</title>
<description>Sintel is a fantasy CGI from the Blender Open Movie Project.</description>
<jwplayer:image>/assets/sintel.jpg</jwplayer:image>
<jwplayer:source file="/assets/sintel-640.mp4" label="360p" />
<jwplayer:source file="/assets/sintel-1280.mp4" label="720p HD" />
<jwplayer:track file="/assets/sintel-en.vtt" label="English" />
<jwplayer:track file="/assets/sintel--fr.vtt" label="Français" />
</item>
</channel>
</rss>
Note that multiple HLS streams and multiple RTMP streams are not supported. Adaptive HLS and dynamic RTMP streams always require an additional manifest file, which is loaded as a single source in the RSS feed.
JW Player also supports direct loading of playlists in RSS format from YouTube. This works in Flash mode only at present (YouTube is working on an HTML5 player API). Every public YouTube playlist can be fetched as RSS through the following URL scheme:
http://gdata.youtube.com/feeds/api/playlists/[PLAYLIST]?alt=rss
Here is an example embed code that displays the CatVidFest playlist:
jwplayer("container").setup({
playlist: "http://gdata.youtube.com/feeds/api/playlists/PLC0B137D835A3C970?alt=rss"
});