HTML5 video doesn’t work in iOS/Safari/Google Chrome

If you use the HTML5 video element, you may see the issues with the iOS. All the browsers on iOS can’t play the HTML5 video.

That issues come from the changes from the iOS that request the server supports byte range transfer.

You can fix it by updating the .htaccess if you are using Apache as a web server

# To make MP4 and other media files can play on the browsers of iOS
SetEnvIfNoCase Request_URI .(?:gif|mp4|ogv|webm)$ no-gzip dont-vary

You need to disable the compression by updating the above line in the mod_deflate of your web server.

In addition, you need to update the attribute playsinline and muted in the HTML5 video tag so that the video can auto play in all browsers.

Here is an example

<video autoplay muted playsinline>
<source src=”video.mp4″></source>

Hope it is useful for you 🙂


No comments yet.

Leave a Reply