<pclass="legacydocsnote">This documentation is for an outdated version of Video.js. See <ahref="https://docs.videojs.com/tutorial-options.html">documentation for the current release</a>.
<p>Alternatively, you can use the data-setup attribute to provide options in the <ahref="http://json.org/example.html">JSON</a> format. This is also how you would set options that aren't standard to the video tag.</p>
<p>Finally, if you're not using the data-setup attribute to trigger the player setup, you can pass in an object with the player options as the second argument in the javascript setup function.</p>
<h3id="note-on-video-tag-attributes">Note on Video Tag Attributes</h3>
<p>With HTML5 video tag attributes that can only be true or false (boolean), you simply include the attribute (no equals sign) to turn it on, or exclude it to turn it off. For example, to turn controls on:</p>
<p>The biggest issue people run into is trying to set these values to false using false as the value (e.g. controls="false") which actually does the opposite and sets the value to true because the attribute is still included. If you need the attribute to include an equals sign for XHTML validation, you can set the attribute's value to the same as its name (e.g. controls="controls").</p>
</blockquote>
<h3id="controls">controls</h3>
<p>The controls option sets whether or not the player has controls that the user can interact with. Without controls the only way to start the video playing is with the autoplay attribute or through the API.</p>
<p>If autoplay is true, the video will start playing as soon as page is loaded (without any interaction from the user).
NOT SUPPORTED BY APPLE iOS DEVICES. Apple blocks the autoplay functionality in an effort to protect it's customers from unwillingly using a lot of their (often expensive) monthly data plans. A user touch/click is required to start the video in this case.</p>
<p>The preload attribute informs the browser whether or not the video data should begin downloading as soon as the video tag is loaded. The options are auto, metadata, and none.</p>
<p>'auto': Start loading the video immediately (if the browser agrees). Some mobile devices like iPhones and iPads will not preload the video in order to protect their users' bandwidth. This is why the value is called 'auto' and not something more final like 'true'.</p>
<p>'metadata': Load only the meta data of the video, which includes information like the duration and dimensions of the video.</p>
<p>'none': Don't preload any of the video data. This will wait until the user clicks play to begin downloading.</p>
<p>The poster attribute sets the image that displays before the video begins playing. This is often a frame of the video or a custom title screen. As soon as the user clicks play the image will go away.</p>