9

Autoplay muted videos in Chrome 66

 3 years ago
source link: https://sampo.co.uk/blog/autoplay-muted-videos-in-chrome-66
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Autoplay muted videos in Chrome 66

Saturday, 26 May 2018

The latest version of Google Chrome (version 66) includes autoplay video changes that stops Chrome from automatically playing videos in some scenarios. Apparently Chrome will learn which sites you tend to play videos on and will allow autoplaying of videos for those particular sites. That sounds like a great idea to me - it's incredibly annoying when you land on a page only to be blasted with sound from an unwanted autoplaying video.

Crucially these restrictions are only in place for videos which contain sound. My previous post contained a video which was purely for demonstrating a nice UI feature and as such has no need for any audio. The following code allows the video to autoplay:

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

Using the muted attribute means that the video will play without sound and the playsinline attribute is necessary for the video to autoplay in iOS.

Share this article

Did you like this article? Share it on Facebook and Twitter. Don't forget to subscribe too.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK