Skip to content

Commit

Permalink
Migrate to WKWebView instead of UIWebView (#362)
Browse files Browse the repository at this point in the history
* Change kYTPlayerStateQueued to kYTPlayerStateCued

The public documentation uses the word cued instead of queued: https://developers.google.com/youtube/iframe_api_reference#Events.

* Replace UIWebView for WKWebView.

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.

* Remove deprecated quality methods.

All methods related to quality have been deprecated and removed: https://developers.google.com/youtube/iframe_api_reference#october-24,-2019

* Fix internal returned type for async APIs.

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.
  • Loading branch information
Eric Vargas committed May 8, 2020
1 parent f6b71a7 commit e9dbe9e
Show file tree
Hide file tree
Showing 2 changed files with 391 additions and 393 deletions.

0 comments on commit e9dbe9e

Please sign in to comment.