Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Setting media parameters for WkWebview #136

Open
kschmidt79 opened this issue May 13, 2022 · 1 comment
Open

Setting media parameters for WkWebview #136

kschmidt79 opened this issue May 13, 2022 · 1 comment

Comments

@kschmidt79
Copy link

Hi!

I would like to set some media parameters in the web view to enable html5 video playback for example. We are rendering something in this web view which contains html5 videos. But they are not playing, you just get an image preview of the video.

I found this:

https://developer.apple.com/documentation/webkit/wkwebviewconfiguration

For example this two:
allowsInlineMediaPlayback
https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614793-allowsinlinemediaplayback

mediaTypesRequiringUserActionForPlayback
https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1851524-mediatypesrequiringuseractionfor

Is there a possibility to pass this parameters to the webview object? I'm very new to this topic, maybe someone have an idea.

@m-abs
Copy link
Contributor

m-abs commented May 16, 2022

You might be able to get the configuration object via webview.ios.configuration.

Or this might help.
The wkWebViewConfiguration is a protected property on the WebViewExt class for iOS.
https://github.com/Notalib/nativescript-webview-ext/blob/master/src/webview-ext.ios.ts#L26

So you could access it, but it is not very pretty.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants