Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mediaPlaybackRequiresUserAction deprecated and iOS 9

WKWebViewConfiguration:

  • mediaPlaybackRequiresUserAction has been deprecated since iOS 9

    In WKWebViewConfiguration:

    @available(iOS, introduced: 8.0, deprecated: 9.0)
    open var mediaPlaybackRequiresUserAction: Bool
    

    And specified by Apple

    mediaPlaybackRequiresUserAction

    Deprecated property. Instead, use mediaTypesRequiringUserActionForPlayback

WKWebViewConfiguration:

  • According to Apple's documentation mediaTypesRequiringUserActionForPlayback is only for iOS 10+.

    In WKWebViewConfiguration:

    @available(iOS 10.0, *)
    open var mediaTypesRequiringUserActionForPlayback: WKAudiovisualMediaTypes
    

So here is my question:

as mediaPlaybackRequiresUserAction is deprecated for iOS 9, and mediaTypesRequiringUserActionForPlayback is only for iOS 10+, what can I use for iOS 9?

like image 655
Niko Avatar asked Sep 26 '17 10:09

Niko


1 Answers

There is a property on the WKWebViewConfiguration object you initialize your WKWebView with named requiresUserActionForMediaPlayback.

like image 128
Thomas Elliot Avatar answered Sep 19 '22 17:09

Thomas Elliot