Merged
Conversation
ryanhamley
approved these changes
Sep 29, 2021
avpeery
approved these changes
Sep 30, 2021
Contributor
avpeery
left a comment
There was a problem hiding this comment.
works! tested on iphone 12 with ios 15
rreusser
commented
Sep 30, 2021
stepankuzmin
pushed a commit
that referenced
this pull request
Jan 17, 2023
stepankuzmin
pushed a commit
that referenced
this pull request
Jan 17, 2023
stepankuzmin
added a commit
that referenced
this pull request
Jan 17, 2023
* Prevent fullscreen video source in iOS (#11067) Co-authored-by: Ricky Reusser <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
iOS video issues are not new (see: #6443, #6152) but usually come down to carefully following the Autoplay guide for media and Web Audio APIs docs.
While working through the release tests, we noticed that video sources have an internal video element which opts for fullscreen in iOS (with possible dependence on iOS version and iPad vs. iPhone) 😱 . I personally observed the issue in iOS 15 on an iPhone 7 but not on an iPad with iOS 12.5.4.
The issue can be seen on this page: https://docs.mapbox.com/mapbox-gl-js/example/video-on-a-map/
Before this fix, video sources require user input to play and then take over the whole screen:
before.mp4
Adding
video.playsinline = ''(see: playsinline docs), the video now autoplays as expected:after.mp4
This fix results in correct behavior (autoplay; no fullscreen) on both devices I have access to:
iPhone 7 with iOS 15
iPad Mini with iOS 12.5.4
Launch Checklist
@mapbox/map-design-team@mapbox/static-apisif this PR includes style spec API or visual changes@mapbox/gl-nativeif this PR includes shader changes or needs a native portmapbox-gl-jschangelog:<changelog>Prevent video sources from entering fullscreen on iOS Safari</changelog>