You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2020/02/12 09:54:50 UTC
[GitHub] [cordova-ios] erisu opened a new pull request #785: refactor:
deprecate mediaPlaybackAllowsAirPlay
erisu opened a new pull request #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785
### Motivation and Context
Apple has deprecated the `mediaPlaybackAllowsAirPlay` property in iOS iOS 8.0-9.0.
This property should be replaced with `allowsAirPlayForMediaPlayback`.
### 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
- [x] 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
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] erisu commented on issue #785: refactor: deprecate
mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
erisu commented on issue #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#issuecomment-589961364
@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.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] jcesarmobile commented on a change in pull request
#785: refactor: deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
jcesarmobile commented on a change in pull request #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#discussion_r383585272
##########
File path: CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
##########
@@ -84,7 +84,17 @@ - (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)setti
configuration.mediaTypesRequiringUserActionForPlayback = mediaTypesRequiringUserActionForPlayback;
configuration.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];
- configuration.mediaPlaybackAllowsAirPlay = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
+
+ /*
+ * If the old preference key "MediaPlaybackAllowsAirPlay" exists, use it or default to "YES".
+ * Check if the new preference key "AllowsAirPlayForMediaPlayback" exists and overwrite the "MediaPlaybackAllowsAirPlay" value.
+ */
+ BOOL allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
+ if([settings cordovaSettingForKey:@"AllowsAirPlayForMediaPlayback"] != nil) {
+ allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
Review comment:
Should check AllowsAirPlayForMediaPlayback , right?
```suggestion
allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowsAirPlayForMediaPlayback" defaultValue:YES];
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] knight9999 commented on a change in pull request
#785: refactor: deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
knight9999 commented on a change in pull request #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#discussion_r379717700
##########
File path: CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
##########
@@ -74,9 +74,25 @@ - (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)setti
}
configuration.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:NO];
- configuration.mediaPlaybackRequiresUserAction = [settings cordovaBoolSettingForKey:@"MediaPlaybackRequiresUserAction" defaultValue:YES];
+
+ // Check for usage of the older preference key, alert, and use.
+ BOOL mediaTypesRequiringUserActionForPlayback = [settings cordovaBoolSettingForKey:@"MediaTypesRequiringUserActionForPlayback" defaultValue:YES];
+ NSString *mediaPlaybackRequiresUserActionKey = [settings cordovaSettingForKey:@"MediaPlaybackRequiresUserAction"];
+ if(mediaPlaybackRequiresUserActionKey != nil) {
+ mediaTypesRequiringUserActionForPlayback = [settings cordovaBoolSettingForKey:@"MediaPlaybackRequiresUserAction" defaultValue:YES];
+ }
+ configuration.mediaTypesRequiringUserActionForPlayback = mediaTypesRequiringUserActionForPlayback;
+
Review comment:
These codes are for `mediaTypeRequiringUserActionForPlayback` which (already) included in other PR https://github.com/apache/cordova-ios/pull/784.
Is this necessary for `allowsAirPlayForMediaPlayback` ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] knight9999 commented on a change in pull request
#785: refactor: deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
knight9999 commented on a change in pull request #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#discussion_r379722154
##########
File path: bin/templates/scripts/cordova/defaults.xml
##########
@@ -27,7 +27,7 @@
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
- <preference name="MediaPlaybackRequiresUserAction" value="false" />
+ <preference name="MediaTypesRequiringUserActionForPlayback" value="false" />
Review comment:
This is for mediaTypesRequiringUserActionForPlayback which (already) included in other PR #784.
Or the AllowsAirPlayForMediaPlayback property here?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] jcesarmobile commented on issue #785: refactor:
deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
jcesarmobile commented on issue #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#issuecomment-586904832
If both the old and the new preference are present the old one takes precedence , is that desired?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] codecov-io edited a comment on issue #785: refactor:
deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#issuecomment-586823346
# [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=h1) Report
> Merging [#785](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-ios/commit/4ac155251e78b59ea74c91f29ab0353721dba475?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #785 +/- ##
=======================================
Coverage 74.36% 74.36%
=======================================
Files 13 13
Lines 1845 1845
=======================================
Hits 1372 1372
Misses 473 473
```
| [Impacted Files](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [bin/templates/scripts/cordova/lib/prepare.js](https://codecov.io/gh/apache/cordova-ios/pull/785/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9zY3JpcHRzL2NvcmRvdmEvbGliL3ByZXBhcmUuanM=) | `82.78% <ø> (ø)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=footer). Last update [4ac1552...60795b6](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] knight9999 commented on a change in pull request
#785: refactor: deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
knight9999 commented on a change in pull request #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#discussion_r379721289
##########
File path: bin/templates/project/__PROJECT_NAME__/config.xml
##########
@@ -53,7 +53,7 @@
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
- <preference name="MediaPlaybackRequiresUserAction" value="false" />
+ <preference name="MediaTypesRequiringUserActionForPlayback" value="false" />
Review comment:
This is for `mediaTypesRequiringUserActionForPlayback` which (already) included in other PR https://github.com/apache/cordova-ios/pull/784.
Or the `AllowsAirPlayForMediaPlayback` property here?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] erisu merged pull request #785: refactor: deprecate
mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
erisu merged pull request #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] erisu commented on a change in pull request #785:
refactor: deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
erisu commented on a change in pull request #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#discussion_r383605929
##########
File path: CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
##########
@@ -84,7 +84,17 @@ - (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)setti
configuration.mediaTypesRequiringUserActionForPlayback = mediaTypesRequiringUserActionForPlayback;
configuration.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];
- configuration.mediaPlaybackAllowsAirPlay = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
+
+ /*
+ * If the old preference key "MediaPlaybackAllowsAirPlay" exists, use it or default to "YES".
+ * Check if the new preference key "AllowsAirPlayForMediaPlayback" exists and overwrite the "MediaPlaybackAllowsAirPlay" value.
+ */
+ BOOL allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
+ if([settings cordovaSettingForKey:@"AllowsAirPlayForMediaPlayback"] != nil) {
+ allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
Review comment:
No, this is correct..
It suppose to read the old preference option first and store its to be used if uses still sets the old option, not the new one. But it will though still set the new flag. If the new preference value is set when the old one is or is not set, the value stored is trash for the new preference options.
If this is too complicated, then I want to completely trash the old preference option and done with it. I don't care if the old preference option is completely removed with small step for migration. If the app stops working as intended, they should still be able to figure it out with the build warnings.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] codecov-io commented on issue #785: refactor:
deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#issuecomment-586823346
# [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=h1) Report
> Merging [#785](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-ios/commit/cfc817776366f05d825f56149fbdf1497d6ad976?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #785 +/- ##
=======================================
Coverage 74.36% 74.36%
=======================================
Files 13 13
Lines 1845 1845
=======================================
Hits 1372 1372
Misses 473 473
```
| [Impacted Files](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [bin/templates/scripts/cordova/lib/prepare.js](https://codecov.io/gh/apache/cordova-ios/pull/785/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9zY3JpcHRzL2NvcmRvdmEvbGliL3ByZXBhcmUuanM=) | `82.78% <ø> (ø)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=footer). Last update [cfc8177...1ec9232](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] codecov-io edited a comment on issue #785: refactor:
deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#issuecomment-586823346
# [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=h1) Report
> Merging [#785](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-ios/commit/4ac155251e78b59ea74c91f29ab0353721dba475?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #785 +/- ##
=======================================
Coverage 74.36% 74.36%
=======================================
Files 13 13
Lines 1845 1845
=======================================
Hits 1372 1372
Misses 473 473
```
| [Impacted Files](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [bin/templates/scripts/cordova/lib/prepare.js](https://codecov.io/gh/apache/cordova-ios/pull/785/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9zY3JpcHRzL2NvcmRvdmEvbGliL3ByZXBhcmUuanM=) | `82.78% <ø> (ø)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=footer). Last update [4ac1552...60795b6](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] dpogue commented on a change in pull request #785:
refactor: deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
dpogue commented on a change in pull request #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#discussion_r379724901
##########
File path: bin/templates/project/__PROJECT_NAME__/config.xml
##########
@@ -53,7 +53,7 @@
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
- <preference name="MediaPlaybackRequiresUserAction" value="false" />
+ <preference name="MediaTypesRequiringUserActionForPlayback" value="false" />
Review comment:
@erisu FYI, `value="false"` will not work the way you think it will 🙃
Essentially, `cordovaBoolSettingForKey` expects the value to be a 0 or 1, and turns any other non-zero value truthy. I kinda consider this to be a bug in `cordovaBoolSettingForKey` tbh.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] erisu commented on a change in pull request #785:
refactor: deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
erisu commented on a change in pull request #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#discussion_r379820826
##########
File path: bin/templates/project/__PROJECT_NAME__/config.xml
##########
@@ -53,7 +53,7 @@
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
- <preference name="MediaPlaybackRequiresUserAction" value="false" />
+ <preference name="MediaTypesRequiringUserActionForPlayback" value="false" />
Review comment:
Read the last commit. First commit is from the last Pr. This was built off of the last Pr and should be merged first.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] erisu commented on a change in pull request #785:
refactor: deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
erisu commented on a change in pull request #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#discussion_r379989880
##########
File path: bin/templates/project/__PROJECT_NAME__/config.xml
##########
@@ -53,7 +53,7 @@
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
- <preference name="MediaPlaybackRequiresUserAction" value="false" />
+ <preference name="MediaTypesRequiringUserActionForPlayback" value="false" />
Review comment:
Thank you for bringing this up.
I will take a look at how to improve and fix this behavior so it works the way we expect.
Since my changes are just updating the preference name, for the most part, and that the behavior you are bringing up is applied to all boolean preferences, I will handle it in a separate PR.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] dpogue commented on a change in pull request #785:
refactor: deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
dpogue commented on a change in pull request #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#discussion_r379724901
##########
File path: bin/templates/project/__PROJECT_NAME__/config.xml
##########
@@ -53,7 +53,7 @@
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
- <preference name="MediaPlaybackRequiresUserAction" value="false" />
+ <preference name="MediaTypesRequiringUserActionForPlayback" value="false" />
Review comment:
@erisu FYI, `value="false"` will not work the way you think it will 🙃
Essentially, `cordovaBoolSettingForKey` expects the value to be a 0 or 1, and turns anything other non-zero value truthy. I kinda consider this to be a bug in `cordovaBoolSettingForKey` tbh.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] erisu commented on a change in pull request #785:
refactor: deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
erisu commented on a change in pull request #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#discussion_r383605929
##########
File path: CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
##########
@@ -84,7 +84,17 @@ - (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)setti
configuration.mediaTypesRequiringUserActionForPlayback = mediaTypesRequiringUserActionForPlayback;
configuration.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];
- configuration.mediaPlaybackAllowsAirPlay = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
+
+ /*
+ * If the old preference key "MediaPlaybackAllowsAirPlay" exists, use it or default to "YES".
+ * Check if the new preference key "AllowsAirPlayForMediaPlayback" exists and overwrite the "MediaPlaybackAllowsAirPlay" value.
+ */
+ BOOL allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
+ if([settings cordovaSettingForKey:@"AllowsAirPlayForMediaPlayback"] != nil) {
+ allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
Review comment:
No, this is correct..
It suppose to read the old preference option first and store its to be used if uses still sets the old option, not the new one. But it will though still set the new flag. If the new preference value is set when the old one is or is not set, the value stored is trash for the new preference options.
If this is too complicated, then I want to completely trash the old preference option and done with it. I don't care if the old preference option is completely removed with small step for migration. If the app stops working as intended, they should still be able to figure it out with the build warnings.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] erisu commented on a change in pull request #785:
refactor: deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
erisu commented on a change in pull request #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#discussion_r379990078
##########
File path: bin/templates/scripts/cordova/defaults.xml
##########
@@ -27,7 +27,7 @@
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
- <preference name="MediaPlaybackRequiresUserAction" value="false" />
+ <preference name="MediaTypesRequiringUserActionForPlayback" value="false" />
Review comment:
Same as I mentioned before.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[GitHub] [cordova-ios] codecov-io edited a comment on issue #785: refactor:
deprecate mediaPlaybackAllowsAirPlay
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #785: refactor: deprecate mediaPlaybackAllowsAirPlay
URL: https://github.com/apache/cordova-ios/pull/785#issuecomment-586823346
# [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=h1) Report
> Merging [#785](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=desc) into [master](https://codecov.io/gh/apache/cordova-ios/commit/4ac155251e78b59ea74c91f29ab0353721dba475?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #785 +/- ##
=======================================
Coverage 74.36% 74.36%
=======================================
Files 13 13
Lines 1845 1845
=======================================
Hits 1372 1372
Misses 473 473
```
| [Impacted Files](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [bin/templates/scripts/cordova/lib/prepare.js](https://codecov.io/gh/apache/cordova-ios/pull/785/diff?src=pr&el=tree#diff-YmluL3RlbXBsYXRlcy9zY3JpcHRzL2NvcmRvdmEvbGliL3ByZXBhcmUuanM=) | `82.78% <ø> (ø)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=footer). Last update [4ac1552...94ac2b9](https://codecov.io/gh/apache/cordova-ios/pull/785?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org