Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ private void settings(WebView webView) {
mWebSettings.setAllowUniversalAccessFromFileURLs(false);
}
mWebSettings.setJavaScriptCanOpenWindowsAutomatically(true);
// Issue #339: HTML5 video.play() was rejected with
// "play() can only be initiated by a user gesture" because the default
// gesture requirement was never lifted. Pages that auto-start video
// playback (most short-form video sites) need this off.
mWebSettings.setMediaPlaybackRequiresUserGesture(false);
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

WebSettings#setMediaPlaybackRequiresUserGesture was added in API 17. Since this module’s minSdkVersion is 14, calling it unconditionally can crash on API 14–16 with NoSuchMethodError. Please guard this call with a Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 check (or equivalent) so older devices skip it safely.

Suggested change
mWebSettings.setMediaPlaybackRequiresUserGesture(false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
mWebSettings.setMediaPlaybackRequiresUserGesture(false);
}

Copilot uses AI. Check for mistakes.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {

mWebSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
Expand Down
Loading