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 mediaPlaybackAllowsAirPlay #785

Merged
merged 2 commits into from
Feb 25, 2020

Conversation

erisu
Copy link
Member

@erisu erisu commented Feb 12, 2020

Motivation and Context

Apple has deprecated the mediaPlaybackAllowsAirPlay property in iOS iOS 8.0-9.0.
This property should be replaced with allowsAirPlayForMediaPlayback.

https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614726-mediaplaybackallowsairplay

Description

This PR:

  • Updates the native side to use the new property name.
  • Updates to read the new preference name (AllowsAirPlayForMediaPlayback) 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-mediaPlaybackAllowsAirPlay branch from e26f876 to e7b39f3 Compare February 13, 2020 01:53
@erisu erisu marked this pull request as ready for review February 14, 2020 14:33
@erisu erisu force-pushed the refactor/fix-mediaPlaybackAllowsAirPlay branch from e7b39f3 to 1ec9232 Compare February 17, 2020 05:16
@codecov-io
Copy link

codecov-io commented Feb 17, 2020

Codecov Report

Merging #785 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #785   +/-   ##
=======================================
  Coverage   74.36%   74.36%           
=======================================
  Files          13       13           
  Lines        1845     1845           
=======================================
  Hits         1372     1372           
  Misses        473      473
Impacted Files Coverage Δ
bin/templates/scripts/cordova/lib/prepare.js 82.78% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ac1552...94ac2b9. Read the comment docs.

@jcesarmobile
Copy link
Member

If both the old and the new preference are present the old one takes precedence , is that desired?

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!

@erisu erisu force-pushed the refactor/fix-mediaPlaybackAllowsAirPlay branch from 1ec9232 to 03123e2 Compare February 22, 2020 14:22
Apple has deprecated "mediaPlaybackAllowsAirPlay" in iOS 8.0-9.0.
This flag should be replaced with "allowsAirPlayForMediaPlayback".
Preference name has also been changed to "AllowsAirPlayForMediaPlayback"
@erisu erisu force-pushed the refactor/fix-mediaPlaybackAllowsAirPlay branch from 03123e2 to 60795b6 Compare February 22, 2020 14:26
@erisu
Copy link
Member Author

erisu commented Feb 22, 2020

@jcesarmobile When you have a chance, can you take a look at this PR again please. I flipped the order of priority.

Now, the old preference value should be set first, or defaults to "YES" when missing, but if the new preference name exists, it will take higest priority and overwrite whatever was set from the old preference name.

Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

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

LGTM

@erisu erisu merged commit df33c47 into apache:master Feb 25, 2020
@erisu erisu deleted the refactor/fix-mediaPlaybackAllowsAirPlay branch February 25, 2020 08:50
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.

5 participants