Commit ef400fa
committed
fix(AbsAgentWebSettings): allow media playback without user gesture (#339)
Resolves #339
Issue #339 reports that an embedded video on a page loaded in AgentWeb
fails with:
Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated
by a user gesture.
The platform default for setMediaPlaybackRequiresUserGesture is true, and
AbsAgentWebSettings.settings() never overrides it. Many embedded video
players (TikTok/Douyin share pages, Twitter video, etc.) start playback
programmatically and break under that default.
This change calls mWebSettings.setMediaPlaybackRequiresUserGesture(false)
in settings() so the platform's WebView allows programmatic playback,
matching the behavior most in-app browsers want.
The mixed-content half of the same issue (HTTP video on HTTPS page) is
already handled by the existing setMixedContentMode(MIXED_CONTENT_ALWAYS_ALLOW)
call further down in the same method.1 parent 95d48cd commit ef400fa
1 file changed
Lines changed: 4 additions & 0 deletions
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
0 commit comments