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

Preview Image


Is there a way to auto-generate a preview image for a video. I found the sample code below, but that requires you to manually create an image ahead a time. I'm looking more for something along the lines of seeking 30 seconds into a video and automatically use that frame as the thumbnail preview.

<script type='text/javascript' src='/jwplayer/jwplayer.js'></script>

<div id='mediaplayer'></div>

<script type="text/javascript">
jwplayer('mediaplayer').setup({
'flashplayer': 'player.swf',
'id': 'playerID',
'width': '480',
'height': '270',
'file': '/videos/bunny.mp4',
'image': '/thumbs/bunny.jpg'
});
</script>

6 Community Answers

JeroenW

JW Player Support Agent  
0 rated :

That is possible with the player, with a few lines of javascript. However, it would mean all your videos are buffered on page load, which may cause a lot of unneeded bandwidth costs.

JW Player

User  
0 rated :

I also need this ability, how would it be done? Do you have an example of the JS you are talking about?

Thanks
B

JeroenW

JW Player Support Agent  
0 rated :

I can give you a few lines of pseudo code:

First, ensure you set the “autostart” option to “true” in the embed code. Videos will then autoplay. Also set the “mute” option to “true”, so people won’t hear a blip of audio at the start.

Next, place this script below the player. It will pause the player the moment it starts (first frame visible), plus un-mute the audio:

jwplayer().onPlay(function(){
  this.pause();
  this.setMute(false);
});

JW Player

User  
0 rated :

Thanks!!

JW Player

User  
0 rated :

jwplayer("divMediaplayer").setup({
flashplayer: "/_layouts/mediaplayer2/player.swf",
skin: "/_layouts/mediaplayer2/glow.zip",
file: "somefile.flv",
events: {
onReady: function () { this.play(); this.pause(); }

}

});


This is the way to do it... hope someone can use it :)

Ethan Feldman

JW Player Support Agent  
0 rated :

Thanks for sharing :)

This question has received the maximum number of answers.