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). This is a system configuration that JW Player does not have control over.

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 Basic Video Embed for more info. Next, place the following embed code at the location you want the player to appear:

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

var playerInstance = jwplayer("myElement");
      file: "/uploads/myVideo.mp4",
      width: 640,
      height: 270,
      autostart: true,
      mute: true

Did you find this article helpful?

Please log in to rate this article.