HTML playsinline Attribute

The HTML playsinline attribute is a Boolean attribute that provides a hint to the browser that a video should play within its element's playback area instead of automatically switching to fullscreen or another independent viewing mode.

Elements That Use the playsinline Attribute

The playsinline attribute is used with the <video> element.

Element Description
<video> Provides a hint that video should play within the element's playback area instead of automatically using fullscreen or another independent viewing mode.

Boolean Attribute

The playsinline attribute is a Boolean attribute. Its presence enables the option, so it does not need a value.

<video playsinline>
  ...
</video>

For Boolean attributes, writing a value such as playsinline="false" does not disable the attribute. If the attribute is present, it is considered enabled. To remove the hint, omit the attribute entirely.

How playsinline Works

When playsinline is present, it tells the browser that the video should normally remain within the playback area provided by the <video> element.

The attribute is a hint rather than a guarantee. The browser or device can still provide controls that allow the user to enter fullscreen or another video viewing mode.

Omitting playsinline does not mean that a browser must play the video fullscreen. Many browsers already play video inline by default, so the attribute may have no visible effect in those browsers.

playsinline Examples

Basic Inline Video

Add playsinline to a <video> element to indicate that the video should play within its displayed playback area.

<video controls playsinline>
  <source src="video.mp4" type="video/mp4">
</video>

Inline Video with Other Attributes

The playsinline attribute can be combined with other video attributes such as controls, muted, and loop.

<video controls muted loop playsinline>
  <source src="video.mp4" type="video/mp4">
</video>

Mobile Video Playback

The playsinline attribute is particularly useful on mobile devices where video playback may otherwise use a dedicated viewing mode. It provides a standardized way to indicate that the video should remain within the page's video playback area.

Browser behavior has changed over time, and many modern browsers now play videos inline by default. The attribute remains useful when a page specifically wants to express a preference for inline playback.

Common Mistakes

Do not use playsinline="false" to request fullscreen playback. Because playsinline is a Boolean attribute, its presence makes it enabled regardless of the text assigned to it.

Do not assume that omitting playsinline forces a video into fullscreen mode. Browsers can choose to play video inline even when the attribute is absent.

Do not use playsinline as a replacement for the controls attribute. The two attributes have different purposes: playsinline concerns the preferred playback area, while controls determines whether the browser provides playback controls.

Browser Support

Baseline: Limited availability indicates that a feature is not yet available in all core browsers. Use these features with caution because they may only work in select browsers, so additional compatibility checks may be needed before general use.

The playsinline attribute on the <video> element has limited availability and should be checked when compatibility across all core browsers is required.

Checking Browser Support

For current browser compatibility information, visit Can I Use? . Search for the HTML element or attribute you want to check. You can also narrow your search by entering an element name and attribute name separated by a colon. Search results can include related HTML features, element attributes, input types, APIs, and other technologies, so select the result that most closely matches the feature you are checking.

Try the playsinline Attribute

The example shows the playsinline attribute on a <video> element. Depending on your browser and device, the video may already play inline by default.

Play in Editor

Summary

The HTML playsinline attribute is a Boolean attribute used on the <video> element. It provides a hint that video should play within the element's playback area rather than automatically switching to fullscreen or another independent viewing mode. Omitting the attribute does not require fullscreen playback because browsers can play video inline by default.