Reputation: 47
i have following jwplayer code without playlist which works just fine but i want to add playlist on the rightside of player.
working jwplayer without playlist.
<script type=\'text/javascript\'>
jwplayer(\'player5PdfeedXun0ZaBZpa\').setup({
file: \'http://www.xyz.com/mvideo/mv/'.$row2['url'].'\',
image: \''.$row2['thumb'].'\',
title: \''.$row2['title'].'\',
width: \'60%\',
aspectratio: \'16:9\',
fallback: \'false\',
autostart: \'true\'
});
</script>
for adding playlist i am trying this as per jwplayer documentation but its not working.
<script type=\'text/javascript\'>
jwplayer(\'player5PdfeedXun0ZaBZpa\').setup({
file: \'http://www.xyz.com/mvideo/mv/'.$row2['url'].'\',
image: \''.$row2['thumb'].'\',
title: \''.$row2['title'].'\',
width: \'60%\',
aspectratio: \'16:9\',
fallback: \'false\',
autostart: \'true\'
playlist: [{
image: \'heart.jpg\',
file: \'/assets/sintel.mp4\',
title: \'Sintel Movie Trailer\'
},{
image: \'hate.png\',
file: \'/assets/bunny.mp4\',
title: \'Big Buck Bunny Movie Trailer\'
}],
playlist.position:\'bottom\',
paylist.size:\'90\',
plugin:hd
});
</script>
where i am doing mistake any idea???? when i add playlist then even player dont appear
Upvotes: 1
Views: 947
Reputation: 592
According to this documentation, you are pretty close in your code. But there's a couple of things needed to get this working.
autostart: \'true\'
playlist.position
and playlist.size
parameters are the old way of doing things. Instead, use listbar
.plugins:hd
. You don't need that line unless you specify HD versions of the videos. But if you want to use HD, check out the plugins documentation which shows how to use that parameter.Here's the final code:
<script type=\'text/javascript\'>
jwplayer(\'player5PdfeedXun0ZaBZpa\').setup({
width: \'60%\',
aspectratio: \'16:9\',
fallback: \'false\',
autostart: \'true\',
\'playlist\': [{
image: \'heart.jpg\',
file: \'/assets/sintel.mp4\',
title: \'Sintel Movie Trailer\'
},{
image: \'hate.png\',
file: \'/assets/bunny.mp4\',
title: \'Big Buck Bunny Movie Trailer\'
}],
listbar: {
position: \'bottom\',
size: 90
}
});
</script>
Upvotes: 1