Skip to content

Commit

Permalink
README updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesvangruisen committed May 25, 2020
1 parent 6256deb commit e1c864f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Embed and control YouTube videos in your iOS applications! Neato, right? Let's see how it works.

**0.7.0 Update:** [`WKWebView` breaking changes](#breaking-changes)

## Installation

### Carthage
Expand Down Expand Up @@ -72,8 +74,8 @@ Each `YouTubePlayerView` has methods for controlling the player (play, pause, se
* `func seekTo(seconds: Float, seekAhead: Bool)`
* `func previousVideo()`
* `func nextVideo()`
* `func getCurrentTime()`
* `func getDuration()`
* `func getCurrentTime(completion: ((Double?) -> Void)?)`
* `func getDuration(completion: ((Double?) -> Void)?))`

Please note that calls to all but the first two methods will result in a JavaScript runtime error if they are called before the player is ready. The player will not be ready until shortly after a call to either `loadVideoURL(videoURL: NSURL)` or `loadVideoID(videoID: String)`. You can check the readiness of the player at any time by checking its `ready: Bool` property. These functions run asynchronously, so it is not guaranteed that a call to a play function will be safe if it immediately follows a call to a load function. I plan to update the library soon to add completion handlers to be called when the player is ready.

Expand All @@ -88,3 +90,13 @@ In the meantime, you can also the `YouTubePlayerDelegate` method `playerReady(vi
* `func playerQualityChanged(videoPlayer: YouTubePlayerView, playbackQuality: YouTubePlaybackQuality)`

*Side note:* All these delegate methods are optional which means that you can implement none, all, or some of them in your delegate class.

## Breaking Changes

**0.7.0**
Transitioning from `UIWebView` (deprecated) to `WKWebView` required changing
player calls which return values to be asynchronous. If you upgrade to 0.7.0,
you will need to replace any call to either `getCurrentTime()` and
`getDuration()` with its asynchronous equivalent, [documented
above](#controlling-youtubeplayerview).

0 comments on commit e1c864f

Please sign in to comment.