Reputation: 477
I feel like I'm missing something very obvious here. I've been looking around on the internet for hours, trying different ways but I just can't get it to work. Please refer to the code below:
<script type='text/javascript'>
var playerInstance = jwplayer('myElement');
playerInstance.setup({
playlist: [{
sources: [{
file: 'files/6c497f2e7ed7f1b1723e405d979174c0.mp4',
file: 'files/a97088dfc242fbc3141ab13db6df3380.mp4'
}]
}],
listbar: {
position: "right",
size: 234
}
});
</script>
I'm trying to get it to show a playlist of those two video files to the side, which could then be selected and played. What it currently does is, it'll play the first file in the list, but it doesn't show the second file and also won't play it. What exactly am I doing wrong here?
Thanks in advance for any help.
Upvotes: 1
Views: 714
Reputation: 43895
The best way to play playlists with JW Player is to use an RSS playlist. The playlist's format is in JW Player's version of XML. The playlist must be on a server. The file's extension can be either .xml or .rss. Here's the one used for the demo:
<rss version="2.0" xmlns:jwplayer="https://rss.jwpcdn.com/">
<channel>
<item>
<title>Video 1</title>
<jwplayer:source file="http://glpjt.s3.amazonaws.com/so/av/vid1.mp4" />
</item>
<item>
<title>Video 2</title>
<description></description>
<jwplayer:source file="http://glpjt.s3.amazonaws.com/so/av/vid2.mp4" />
</item>
<item>
<title>Video 3</title>
<description></description>
<jwplayer:source file="http://glpjt.s3.amazonaws.com/so/av/vid3.mp4" />
</item>
</channel>
</rss>
REFERENCE
Upvotes: 1