Autostarting on Page Load

This article explains how to automatically start playback of your media on page load. Since autostarting can be annoying at times, we'll also mute the media by default. Here is an example:

 

Note that autostarting does not work on mobile phones (Android, iOS), since a fullscreen video takeover would be a jarring experience. Video also swiftly depletes 3G/4G bandwidth allowances.

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 an embedding guide like MP4 Video Embed 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",
      width: 640,
      height: 270,
      autostart: true,
      mute: true
    });
</script>
Please sign in to leave your feedback for this article.

Still don't have JW Player? Get It Here