Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent fullscreen video source in iOS #11067

Merged
merged 1 commit into from Oct 1, 2021
Merged

Prevent fullscreen video source in iOS #11067

merged 1 commit into from Oct 1, 2021

Conversation

rreusser
Copy link
Contributor

@rreusser rreusser commented Sep 29, 2021

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

  • briefly describe the changes in this PR
  • include before/after visuals or gifs if this PR includes visual changes
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page
  • tagged @mapbox/map-design-team @mapbox/static-apis if this PR includes style spec API or visual changes
  • tagged @mapbox/gl-native if this PR includes shader changes or needs a native port
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Prevent video sources from entering fullscreen on iOS Safari</changelog>

Copy link
Contributor

@avpeery avpeery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works! tested on iphone 12 with ios 15

@rreusser rreusser merged commit ba69792 into main Oct 1, 2021
@rreusser rreusser deleted the ricky/fix-ios-video branch October 1, 2021 17:06
stepankuzmin added a commit that referenced this pull request Jan 17, 2023
* Prevent fullscreen video source in iOS (#11067)

Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants