Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document allowsInlineMediaPlayback, an important step to make it work inside iOS WebView #261

Open
benma opened this issue Sep 26, 2024 · 0 comments

Comments

@benma
Copy link

benma commented Sep 26, 2024

qr-scanner puts a playsInline attribute on the <video> element. In iOS WebView, this has no effect unless you explicitly enable it:

let config = WKWebViewConfiguration()
// The QR code scanner uses a <video> element with an playsInline attribute.
// This setting allows this attribute. Otherwise the QR code scanner would
// go full screen and contain player controls (pause button),
// a "livestream" label and casting abilities.
config.allowsInlineMediaPlayback = true;        

let webView = WKWebView(frame: .zero, configuration: config)

// ...

It took me some time to figure out why the scanner was completely borked on iOS, so I think it would be helpful to put this info in the README.

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

No branches or pull requests

1 participant