Fix HTML5 Video Not Autoplaying in Safari on iPhone and iPad

Quick Summary

  • Add the playsinline attribute to the video element, because Safari on iPhone won't autoplay a video that would open in fullscreen.
  • Keep muted alongside autoplay, loop and playsinline, since browsers generally block autoplay for videos with sound.
  • autoplay, loop, muted and playsinline are boolean attributes that turn on when present, and the WordPress Video block calls playsinline Play inline.

A muted, looping background video with autoplay can play in desktop browsers and still refuse to start on an iPhone. On iPhone, Safari plays video in fullscreen unless the <video> element has the playsinline attribute, and it won’t autoplay a video that would have to open in fullscreen.

Won’t autoplay on iPhone

This version has autoplay, loop and muted, but no playsinline:

HTML
<video autoplay="true" loop="true" muted>
    <source src="example.mp4" type="video/mp4">
</video>

Works: add playsinline

Adding playsinline lets the video play inside the page, so autoplay starts:

HTML
<video autoplay="true" loop="true" playsinline muted>
    <source src="example.mp4" type="video/mp4">
</video>
  • Keep muted. Browsers generally block autoplay for videos with sound.
  • autoplay, loop, muted and playsinline are boolean attributes: their presence turns them on. autoplay="true" works the same as plain autoplay, and autoplay="false" would still turn it on.
  • In the WordPress Video block, the same attribute is the Play inline setting in the block sidebar.

Video reference: https://youtu.be/M1UzCyJHdwQ

See also: How to Add Wistia Videos in WordPress.

Share on X (opens in a new tab) Share on LinkedIn (opens in a new tab) Share on Facebook (opens in a new tab)

ChatGPT (opens in a new tab) Claude (opens in a new tab) Gemini (opens in a new tab) Perplexity (opens in a new tab) Grok (opens in a new tab)

More Insights

See More