From 0b0fed85505ca93f158327e85e0b5a6f80cfbf96 Mon Sep 17 00:00:00 2001 From: Stepan Kuzmin Date: Tue, 17 Jan 2023 15:57:56 +0200 Subject: [PATCH] Backport video source fix for iOS into `v1.13.3` (#12524) * Prevent fullscreen video source in iOS (#11067) Co-authored-by: Ricky Reusser --- CHANGELOG.md | 1 + src/source/video_source.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30b63ab2d45..bf3b900b75d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### 🐞 Bug fixes * Fix incorrect billing when `customAccessToken` is provided along with non-Mapbox tiles ([#12520](https://github.com/mapbox/mapbox-gl-js/issues/12520)) +* Prevent video sources from entering fullscreen on iOS Safari ([#11067](https://github.com/mapbox/mapbox-gl-js/issues/11067)) * Upgrade minimist to ^1.2.7 to avoid [CVE-2021-44906](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44906) ([#12442](https://github.com/mapbox/mapbox-gl-js/issues/12442)) (h/t @Spasfonx) ## 1.13.2 diff --git a/src/source/video_source.js b/src/source/video_source.js index e10f9c18379..a6d23584743 100644 --- a/src/source/video_source.js +++ b/src/source/video_source.js @@ -79,6 +79,9 @@ class VideoSource extends ImageSource { this.video = video; this.video.loop = true; + // Prevent the video from taking over the screen in iOS + this.video.setAttribute('playsinline', ''); + // Start repainting when video starts playing. hasTransition() will then return // true to trigger additional frames as long as the videos continues playing. this.video.addEventListener('playing', () => {