From 808e2f886f4ca6d61bd2b4d28f79e3925c41687d Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Sat, 10 Apr 2021 12:38:04 +0000 Subject: [PATCH] Customize: Set `playsinline` attribute for custom header videos. With the `playsinline` attribute the video can also autoplay on mobile browsers without asking the user to open it up fullscreen. Also, change all video element properties to use boolean values. Props klevyke, ocean90. Fixes #50111. git-svn-id: https://develop.svn.wordpress.org/trunk@50698 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/wp/custom-header.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js/_enqueues/wp/custom-header.js b/src/js/_enqueues/wp/custom-header.js index 5a446727fa..ae43f56174 100644 --- a/src/js/_enqueues/wp/custom-header.js +++ b/src/js/_enqueues/wp/custom-header.js @@ -287,9 +287,10 @@ video = document.createElement( 'video' ); video.id = 'wp-custom-header-video'; - video.autoplay = 'autoplay'; - video.loop = 'loop'; - video.muted = 'muted'; + video.autoplay = true; + video.loop = true; + video.muted = true; + video.playsInline = true; video.width = this.settings.width; video.height = this.settings.height;