Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

playsinline — video playback within the page

The boolean playsinline attribute hints that a browser should play video within the element's playback area rather than fullscreen or in a separate window. It is a hint, not a guarantee; omitting it does not force fullscreen.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

<video playsinline></video>

playsinline is a boolean attribute of the video element. Its presence hints that video should default to display within the document, constrained to the element's playback area, rather than fullscreen or in a separate resizable window. This is a browser hint, not an unconditional presentation requirement.

Omitting playsinline does not mean fullscreen: a browser may play video within the page by default. The attribute does not start playback and does not replace autoplay or controls.

Valid forms are playsinline, playsinline="", and playsinline="playsinline". Writing playsinline="false" violates boolean attribute syntax and still leaves the attribute present. To disable the hint, remove the attribute.

In JavaScript, the corresponding property is HTMLVideoElement's playsInline, with an uppercase I. It reflects attribute presence: assigning false removes the attribute, and assigning true adds it. The example checks this relationship without a media file; it does not test actual video presentation.

Examples

<!doctype html>
<meta charset="utf-8">
<title>playsinline</title>
<video id="clip" playsinline controls></video>
<pre id="result"></pre>
<script>
  const clip = document.getElementById('clip');
  const states = [clip.playsInline];
  clip.playsInline = false;
  states.push(clip.hasAttribute('playsinline'));
  clip.playsInline = true;
  states.push(clip.hasAttribute('playsinline'));
  document.getElementById('result').textContent = states.join('\n');
</script>

Result

true
false
true

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources