Example: A Poster-less Preview

Here is an example of a setup of JW Player displays a video preview without poster image:

 

 

 


This feature is built using the JW Player JavaScript API, with just a few lines of JavaScript code.

Embed code

As always, ensure you have uploaded a copy of JW Player and included the script in the <head> of your page, together with your player key. See the Quick Start Guide for more info. Next, place the following embed code at the location you want the player to appear:

<div id="myElement"></div>

<script>
  jwplayer("myElement").setup({
    file: "/uploads/myVideo.mp4",
    autostart: true,
    mute: true,
    controls: false
  });
</script>

Note the video is set to autostart, with the volume muted and the controls hidden (so they don't flicker on and off).

Second, add the JavaScript to pause and un-mute the video and display the controls:

<script>
  setTimeout(function() { 
    jwplayer().pause();
    jwplayer().setMute(false);
    jwplayer().setControls(true);
  },3000);
</script>

Change the value of 3000 (milliseconds) for another preview frame. See Using the JavaScript API for more info.

Please sign in to leave your feedback for this article.

Still don't have JW Player? Get It Here