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

playlist not auto play when clicked


Hello!

Is there a way to click a playlist item and NOT have it automatically play the video?

I need it to ONLY show the video preview image in player window when the playlist item is clicked, and the user needs to click play to start the video.

I have not been able to find examples like this but have a request to build it this way.

Many thanks in advance for any help.
Grace

4 Community Answers

Todd

JW Player Support Agent  
0 rated :

My recommendation would be to build your own custom playlist listbar for this. Please see my example at http://qa.jwplayer.com/~todd/playlist-custom-listbar.html

If you do not want the listbar to play the video on click, remove the onClick function from the div.

gammagrace

User  
0 rated :

HI Todd, Thanks for your reply.
From your example, I took this code and put it at the end of my player script:
jwplayer().onReady(function(){
var myVideos = jwplayer().getPlaylist();
for (var i = 0; i < myVideos.length; i++) {
document.getElementById('listbar').innerHTML += '<div class=listbar_item onClick="jwplayer().playlistItem(' + i + ');"><img style="float: left; height: 60px; margin-right: 5px;" src=' + myVideos[i].image + '><b>' + myVideos[i].title + '</b><br>' + myVideos[i].description + '</div>';
}
});

and then I edited to remove the onClick part, so it looked like this:
jwplayer().onReady(function(){
var myVideos = jwplayer().getPlaylist();
for (var i = 0; i < myVideos.length; i++) {
document.getElementById('listbar').innerHTML += '<img style="float: left; height: 60px; margin-right: 5px;" src=' + myVideos[i].image + '><b>' + myVideos[i].title + '</b><br>' + myVideos[i].description + '</div>';
}
});

I tried various edits to remove the onClick line but nothing has worked.

I am trying to NOT load the video when a user click on the playlist item. I want it to just show the preview image, and then the user needs to click on the play button to start the video.

Do I need to completely remove the onClick line or adjust it to call something different.

I hope this makes sense. If you could help shed some light on what I am missing, I would be so happy.

Thanks!
Grace

Todd

JW Player Support Agent  
0 rated :

My suggestion would be to call jwplayer().stop(); immediately after the jwplayer().playlistItem(); in your onClick.

onClick=“jwplayer().playlistItem(’ + i + ’);jwplayer().stop();”

gammagrace

User  
0 rated :

Hi Todd, First off thanks so much for your reply. I really appreciate you taking the time to assist with this.

I am trying to add your onClick line, but not sure where to add this line to the html page.
onClick="jwplayer().playlistItem(' + i + ');jwplayer().stop();"

currently my player script looks like this:
<code>
<script src="js/jwplayer-5.9.js" type="text/javascript"></script>
<div id="myplayer">Featured Video</div>
<script type="text/javascript">
jwplayer("myplayer").setup({
height: 340,
allowfullscreen: "true",
allowscriptaccess: "always",
backcolor: "CCCCCC",
frontcolor: "336699",
lightcolor: "ffffff",
screencolor: "ffffff",
wmode: "opaque",
controlbar: "bottom",
autostart: "false",
stretching: "fill",
file: "playlist8.rss",
'playlist.position': 'right',
'playlist.size': '335',
repeat: "list",
shuffle: "false",
skin: "skins/glow/glow3.xml",
plugins: "captions-2",
modes: [
{ type: 'flash', src: 'player.swf' },
{ type: 'html5' }
],
width: 830
});

</script>


I tried pasting it to the end of the script, but no dice. Would you be able to help me to locate where this line goes. I am not sure if it even goes in the player settings or outside in it's own script.

Any ideas or insight into this puzzle would be awesome.
Thanks again! Grace

This question has received the maximum number of answers.