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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoplay detection: fix fullscreen issue on iOS #11822

Merged

Conversation

github-matthieu-wipliez
Copy link
Contributor

Type of change

  • Bugfix

Description of change

This PR improves the autoplay detection to prevent the video from going fullscreen if autoplay succeeds.

Other information

@github-matthieu-wipliez github-matthieu-wipliez marked this pull request as ready for review June 18, 2024 13:32
@patmmccann patmmccann changed the title Improve autoplay detection to fix fullscreen issue on iOS Autoplay detection: fix fullscreen issue on iOS Jun 18, 2024
@patmmccann patmmccann linked an issue Jun 18, 2024 that may be closed by this pull request
const version = navigator.userAgent.match(/iPhone OS (\d+)_(\d+)/)
if (version !== null && parseInt(version[1]) < 17 && !navigator.userAgent.includes('Safari')) {
// skip autodetection on iOS 16 WebView
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

This return is not in a function and fails the linter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops my bad, thanks for pointing this out! I'm used to TypeScript + Webpack taking care of this automatically for me, and did not take the time to test it locally on Prebid 😅 I'll fix this tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have fixed the code and rebased on master, it's all good now @patmmccann 👍

@patmmccann patmmccann merged commit d4cae0a into prebid:master Jun 21, 2024
5 checks passed
@github-matthieu-wipliez github-matthieu-wipliez deleted the autoplay-fix-fullscreen branch June 21, 2024 07:37
DecayConstant pushed a commit to mediavine/Prebid.js that referenced this pull request Jul 18, 2024
* Improve autoplay detection to fix fullscreen issue on iOS

* Skip autodetection on WebView on iOS < 17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Teads: AutoplayDetection causes fullscreen video on WKWebView
2 participants