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

refactor: deprecate mediaPlaybackRequiresUserAction #784

Merged

Conversation

erisu
Copy link
Member

@erisu erisu commented Feb 12, 2020

Motivation and Context

Apple has deprecated the mediaPlaybackRequiresUserAction property in iOS 8.0–9.0.
This property should be replaced with mediaTypesRequiringUserActionForPlayback.

https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614727-mediaplaybackrequiresuseraction

Description

This PR:

  • Updates the native side to use the new property name.
  • Updates to read the new preference name (MediaTypesRequiringUserActionForPlayback) from config.xml
  • Warn users that the preference is being deprecated in the near future if it is still being used.
  • Fallback on the the value from the old preference name if it still remains.

Testing

  • npm t
  • cordova platform add
  • cordova build ios

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • I've updated the documentation if necessary

@erisu erisu added this to the 6.0.0 milestone Feb 12, 2020
@erisu erisu force-pushed the refactor/fix-mediaPlaybackRequiresUserAction-flag branch from b090677 to 077c835 Compare February 12, 2020 09:46
Apple has deprecated "mediaPlaybackRequiresUserAction" in iOS 4.0-12.0.
This flag should be replaced with "mediaTypesRequiringUserActionForPlayback".
Preference name has also been changed to "MediaTypesRequiringUserActionForPlayback"
@erisu erisu force-pushed the refactor/fix-mediaPlaybackRequiresUserAction-flag branch from 077c835 to b8d2c57 Compare February 13, 2020 01:54
@erisu erisu marked this pull request as ready for review February 14, 2020 14:33
Copy link
Contributor

@knight9999 knight9999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me.

@erisu erisu merged commit cfc8177 into apache:master Feb 17, 2020
@erisu erisu deleted the refactor/fix-mediaPlaybackRequiresUserAction-flag branch February 17, 2020 04:56
@jcesarmobile
Copy link
Member

Sorry for the late review, but mediaTypesRequiringUserActionForPlayback doesn’t accept true or false values, if true it should just do nothing, if false it should set the value to WKAudiovisualMediaTypeNone.
For false is not a real problem since false and WKAudiovisualMediaTypeNone have 0 value, but setting to true will be unexpected.

NiklasMerz pushed a commit to GEDYSIntraWare/cordova-ios that referenced this pull request Feb 24, 2020
Apple has deprecated "mediaPlaybackRequiresUserAction" in iOS 8.0–9.0.
This flag should be replaced with "mediaTypesRequiringUserActionForPlayback".
Preference name has also been changed to "MediaTypesRequiringUserActionForPlayback"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants