Video from local storage not playing in WebView (Xamarin.Forms) after latest iOS update (12.2)

前端 未结 5 1408
遥遥无期
遥遥无期 2021-01-05 14:12

I have an existing Xamarin Forms application, for Android and iOS, which shows some HTML content from local storage (the purpose is to view this content while offline) in We

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-05 14:40

    Try setting mediaPlaybackRequiresUserAction to NO for the webview. I'm seeing the same issue (UIWebView and WKWebView both) in iOS 12.2. Works fine in iOS 12.1 and earlier.

    When debugging, you see this error in safari console:

    Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission

    https://developer.apple.com/documentation/uikit/uiwebview/1617954-mediaplaybackrequiresuseraction?language=objc

    https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614727-mediaplaybackrequiresuseraction?language=objc

提交回复
热议问题