From f3034f1b1c407e900aec5a93bba2777b08b093e0 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Sat, 10 Apr 2021 12:40:05 +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. Built from https://develop.svn.wordpress.org/trunk@50698 git-svn-id: http://core.svn.wordpress.org/trunk@50307 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/wp-custom-header.js | 7 ++++--- wp-includes/js/wp-custom-header.min.js | 2 +- wp-includes/version.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/wp-includes/js/wp-custom-header.js b/wp-includes/js/wp-custom-header.js index 5a446727fa..ae43f56174 100644 --- a/wp-includes/js/wp-custom-header.js +++ b/wp-includes/js/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; diff --git a/wp-includes/js/wp-custom-header.min.js b/wp-includes/js/wp-custom-header.min.js index 3c88813e3c..8573af68fa 100644 --- a/wp-includes/js/wp-custom-header.min.js +++ b/wp-includes/js/wp-custom-header.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(n,t){var e,i;function a(e,t){var i;"function"==typeof n.Event?i=new Event(t):(i=document.createEvent("Event")).initEvent(t,!0,!0),e.dispatchEvent(i)}function o(){this.handlers={nativeVideo:new e,youtube:new i}}function s(){}n.wp=n.wp||{},"addEventListener"in n&&(o.prototype={initialize:function(){if(this.supportsVideo())for(var e in this.handlers){e=this.handlers[e];if("test"in e&&e.test(t)){this.activeHandler=e.initialize.call(e,t),a(document,"wp-custom-header-video-loaded");break}}},supportsVideo:function(){return!(n.innerWidth