Skip to content

Commit 1553a2b

Browse files
committed
Merge branch 'release/2.11.0'
2 parents 1bd1061 + 577d21c commit 1553a2b

22 files changed

+2413
-382
lines changed

.jazzy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ source_directory: XCDYouTubeKit
44
framework_root: .
55
umbrella_header: XCDYouTubeKit/XCDYouTubeKit.h
66
module: XCDYouTubeKit
7-
module_version: 2.10.0
7+
module_version: 2.11.0
88

99
author: Cédric Luthi
1010
author_url: https://twitter.com/0xced
1111

1212
readme: README.md
1313
github_url: https://github.com/0xced/XCDYouTubeKit
14-
github_file_prefix: https://github.com/0xced/XCDYouTubeKit/tree/2.10.0/XCDYouTubeKit
14+
github_file_prefix: https://github.com/0xced/XCDYouTubeKit/tree/2.11.0/XCDYouTubeKit

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#### Version 2.11.0
2+
3+
* `-[XCDYouTubeClient queryVideo:video:cookies:completionHandler:]` completion handler is now correctly called on the main thread.
4+
* Improved video querying to handle videos that have incomplete streams. (#456)
5+
* Errors returned in `streamErrors` may contain the `NSLocalizedRecoverySuggestionErrorKey` key in `-[NSError userInfo]` when `NSURLErrorNetworkConnectionLost` is reported, this may indicate the file is incomplete on YouTube's server.
6+
* Add logging to `XCDYouTubeVideoQueryOperation` class.
7+
* Improved `-[XCDYouTubeVideoQueryOperation description]`.
8+
19
#### Version 2.10.0
210

311
* Fixed issue that caused certain videos to return error (#468)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ XCDYouTubeKit is available through [CocoaPods](https://cocoapods.org/), [Carthag
3333
CocoaPods:
3434

3535
```ruby
36-
pod "XCDYouTubeKit", "~> 2.10"
36+
pod "XCDYouTubeKit", "~> 2.11"
3737
```
3838

3939
Carthage:
4040

4141
```objc
42-
github "0xced/XCDYouTubeKit" ~> 2.10
42+
github "0xced/XCDYouTubeKit" ~> 2.11
4343
```
4444

4545
Swift Package Manager:
@@ -48,7 +48,7 @@ Add `XCDYouTubeKit` to the dependencies value of your `Package.swift`
4848

4949
```swift
5050
dependencies: [
51-
.package(url: "https://github.com/0xced/XCDYouTubeKit.git", from: "2.10.0")
51+
.package(url: "https://github.com/0xced/XCDYouTubeKit.git", from: "2.11.0")
5252
]
5353
```
5454

XCDYouTubeKit Demo/OS X Demo/AppDelegate.m

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,30 @@ - (IBAction) playVideo:(id)sender
2525
[self.progressIndicator startAnimation:sender];
2626
[[XCDYouTubeClient defaultClient] getVideoWithIdentifier:[sender stringValue] completionHandler:^(XCDYouTubeVideo *video, NSError *error)
2727
{
28-
[self.progressIndicator stopAnimation:sender];
2928

3029
if (video)
3130
{
32-
NSDictionary *streamURLs = video.streamURLs;
33-
NSURL *url = streamURLs[XCDYouTubeVideoQualityHTTPLiveStreaming] ?: streamURLs[@(XCDYouTubeVideoQualityHD720)] ?: streamURLs[@(XCDYouTubeVideoQualityMedium360)] ?: streamURLs[@(XCDYouTubeVideoQualitySmall240)];
34-
AVPlayer *player = [AVPlayer playerWithURL:url];
35-
self.playerView.player = player;
36-
[player play];
31+
32+
[[XCDYouTubeClient defaultClient] queryVideo:video cookies:nil completionHandler:^(NSDictionary * _Nonnull streamURLs, NSError * _Nullable streamError, NSDictionary<id,NSError *> * _Nonnull streamErrors)
33+
{
34+
[self.progressIndicator stopAnimation:sender];
35+
36+
if (streamURLs)
37+
{
38+
NSURL *url = streamURLs[XCDYouTubeVideoQualityHTTPLiveStreaming] ?: streamURLs[@(XCDYouTubeVideoQualityHD720)] ?: streamURLs[@(XCDYouTubeVideoQualityMedium360)] ?: streamURLs[@(XCDYouTubeVideoQualitySmall240)];
39+
AVPlayer *player = [AVPlayer playerWithURL:url];
40+
self.playerView.player = player;
41+
[player play];
42+
}
43+
else
44+
{
45+
[[NSAlert alertWithError:streamError] runModal];
46+
}
47+
}];
3748
}
3849
else
3950
{
51+
[self.progressIndicator stopAnimation:sender];
4052
[[NSAlert alertWithError:error] runModal];
4153
}
4254
}];

XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@
760760
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
761761
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
762762
COPY_PHASE_STRIP = NO;
763-
CURRENT_PROJECT_VERSION = 2.10.0;
763+
CURRENT_PROJECT_VERSION = 2.11.0;
764764
ENABLE_STRICT_OBJC_MSGSEND = YES;
765765
ENABLE_TESTABILITY = YES;
766766
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -804,7 +804,7 @@
804804
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
805805
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
806806
COPY_PHASE_STRIP = YES;
807-
CURRENT_PROJECT_VERSION = 2.10.0;
807+
CURRENT_PROJECT_VERSION = 2.11.0;
808808
ENABLE_STRICT_OBJC_MSGSEND = YES;
809809
GCC_C_LANGUAGE_STANDARD = gnu99;
810810
GCC_NO_COMMON_BLOCKS = YES;

XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testThatQueryingLiveVideoReturnsPlayableStreams.json

Lines changed: 238 additions & 0 deletions
Large diffs are not rendered by default.

XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testVideo1ReturnsNoPlayableStreamsBecauseConnectionError.json

Lines changed: 73 additions & 27 deletions
Large diffs are not rendered by default.

XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testVideo1ReturnsSomePlayableStreams.json

Lines changed: 145 additions & 62 deletions
Large diffs are not rendered by default.

XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testVideo1ReturnsSomePlayableStreamsEvenIfSomeFailDueToConnectionError.json

Lines changed: 110 additions & 54 deletions
Large diffs are not rendered by default.

XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testVideo2ReturnsAllPlayableStreams.json

Lines changed: 629 additions & 172 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)