Using webview in mobile application

    Using webview in mobile application


    Article summary

    To use the Shoplive player properly in iOS WKWebview, the following settings are required.

    allowsInlineMediaPlayback

    The allowsInlineMediaPlayback in WKWebViewConfiguration must be set to true. This is an option to set whether to allow video tag inline playback, and must be set to true to enable normal player operation in WKWebView.

    let configuration = WKWebViewConfiguration()
    configuration.allowsInlineMediaPlayback = true
    let webView = WKWebView(frame: rect, configuration: configuration)

    For more information about allowsInlineMediaPlayback in WKWebView configuration, refer to the following document.

    Shoplive player is based on WKWebView and does not officially support the discontinued UIWebView. For more information about UIWebView deprecation, refer to the following.


    UIWebview

    If your customer's mobile application is currently using UIWebView, we recommend switching to WKWebView. (UIWebView has been deprecated as official support has ended on iOS.) If you inevitably use UIWebView, the following settings are required, just like WKWebView.

    let configuration = WKWebViewConfiguration()
    configuration.allowsInlineMediaPlayback = true
    let webView = WKWebView(frame: rect, configuration: configuration)

    For more information about allowsInlineMediaPlayback in UIWebview configuration, refer to the following document.


    What's Next