Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save uazo/3e46ffe8626b09864102fe4091c52559 to your computer and use it in GitHub Desktop.
Save uazo/3e46ffe8626b09864102fe4091c52559 to your computer and use it in GitHub Desktop.
01-Fix-2096-Revert the removal of an option to block (fixup).patch
From: Your Name <you@example.com>
Date: Fri, 1 Jul 2022 12:57:24 +0000
Subject: Revert the removal of an option to block (fixup)
---
third_party/blink/renderer/core/html/media/autoplay_policy.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/third_party/blink/renderer/core/html/media/autoplay_policy.cc
--- a/third_party/blink/renderer/core/html/media/autoplay_policy.cc
+++ b/third_party/blink/renderer/core/html/media/autoplay_policy.cc
@@ -311,12 +311,14 @@ void AutoplayPolicy::TryUnlockingUserGesture() {
}
bool AutoplayPolicy::IsGestureNeededForPlayback() const {
+ if (!IsAutoplayAllowedPerSettings())
+ return true;
if (!IsLockedPendingUserGesture())
return false;
// We want to allow muted video to autoplay if the element is allowed to
// autoplay muted.
- return !(IsEligibleForAutoplayMuted() && IsAutoplayAllowedPerSettings());
+ return !IsEligibleForAutoplayMuted();
}
String AutoplayPolicy::GetPlayErrorMessage() const {
--
2.25.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment