-
Notifications
You must be signed in to change notification settings - Fork 673
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
Migrate to WKWebView instead of UIWebView #362
Conversation
The public documentation uses the word cued instead of queued: https://developers.google.com/youtube/iframe_api_reference#Events.
Is there a current plan as far as merging this and doing a release? |
Replaced all references to UIWebView with WKWebView. Had to change APIs, most of the work is that the JS calls that return values, e.g. getDuration() are now async. All methods that expect a return value now use a callback for the expected async result.
All methods related to quality have been deprecated and removed: https://developers.google.com/youtube/iframe_api_reference#october-24,-2019
When will this PR be merged? |
It would be good that this fix is merge ASAP as Apple is now refusing new builds with UIWebView
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apple is now refusing new builds with UIWebView
Can we have a date for this to go up? I can't upload my builds to Test Flight because of this. |
UIWebView used to always returned the JS result as an NSString, but with WKWebView the type is inferred when returned making it so that the current logic of stringFromEvaluatingJavaScript:completionHandler: is not sufficient to capture the types returned by the iFrame API.
Fix internal returned type for async APIs.
if (!result || ![result isKindOfClass:[NSNumber class]]) { | ||
completionHandler(0, nil); | ||
} | ||
completionHandler([result floatValue], nil); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case if the result
is not an NSNumber
instance, this may crash (in case of result does not have floatValue
function) or completionHandler
will be called twice(otherwise).
either need to return in the if
or need an else
?
This is applicable to other sections too...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for noticing, will be posting a fix for this soon.
Hello, Apple is rejecting builds now due to this. Please let us know when will be you able to merge the changes? |
This is merged already. |
…andler Follow-up to PR #362: Missing a return statement in several places, which resulted in both the correct and incorrect completionHandlers being called. This could lead to crashes if the callback result is empty or represents an unexpected type.
You need to wait for a release to happen or use a custom pod to point to the master branch, as such: |
Installing through cocoapods is currently out of sync and might be broken. We are working on updating the pod repo. |
@rcvrgs @L4grange |
I'm also facing an issue where every time I try to load a video, safari opens with my bundle ID as the URL, as I've stated in #374 but I'm not sure if this PR is the cause or something else. (maybe the broken pod implementation?), so I would advise against using the master branch in your production for now. |
Yes, this is what is happening with me too. |
@rcvrgs can you give an idea as to by when it would be synced? |
Hi all,
Please use the latest version - |
There is going to be a follow up CL to update the sample app. Right now the library has been migrated to WKWebVIew.