Skip to content

Commit 65d9b79

Browse files
Add mediaPlaybackRequiresUserGesture option to AndroidWebsettings
1 parent b5650e2 commit 65d9b79

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

webview/src/androidMain/kotlin/com/multiplatform/webview/web/AccompanistWebView.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ fun AccompanistWebView(
201201
defaultFontSize = it.defaultFontSize
202202
loadsImagesAutomatically = it.loadsImagesAutomatically
203203
domStorageEnabled = it.domStorageEnabled
204+
mediaPlaybackRequiresUserGesture = it.mediaPlaybackRequiresUserGesture
204205
}
205206
}
206207
if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)) {

webview/src/commonMain/kotlin/com/multiplatform/webview/setting/PlatformWebSettings.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ sealed class PlatformWebSettings {
162162
* Whether the DOM storage API is enabled. The default value is {@code false}.
163163
*/
164164
var domStorageEnabled: Boolean = false,
165+
/**
166+
* Whether the a user gesture is required to play media. The default is {@code true}.
167+
*/
168+
var mediaPlaybackRequiresUserGesture: Boolean = true,
165169
/**
166170
* The Layer Type of the WebView.
167171
* Default is [LayerType.HARDWARE]

0 commit comments

Comments
 (0)