Using webview in mobile application

    Using webview in mobile application


    Article summary

    Using Shoplive Player in iOS WKWebview

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

    allowsInlineMediaPlayback

    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, please refer to the following document.

    https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614793-allowsinlinemediaplayback

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

    https://developer.apple.com/documentation/uikit/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, please refer to the following document.

    https://developer.apple.com/documentation/uikit/uiwebview/1617960-allowsinlinemediaplayback



    What's Next