Skip to content

Commit

Permalink
Merge branch 'release/2.13.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
SoneeJohn committed Apr 27, 2020
2 parents 50592e3 + 3be66af commit d6f4b0e
Show file tree
Hide file tree
Showing 13 changed files with 280 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ source_directory: XCDYouTubeKit
framework_root: .
umbrella_header: XCDYouTubeKit/XCDYouTubeKit.h
module: XCDYouTubeKit
module_version: 2.12.0
module_version: 2.13.0

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

readme: README.md
github_url: https://github.com/0xced/XCDYouTubeKit
github_file_prefix: https://github.com/0xced/XCDYouTubeKit/tree/2.12.0/XCDYouTubeKit
github_file_prefix: https://github.com/0xced/XCDYouTubeKit/tree/2.13.0/XCDYouTubeKit
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#### Version 2.13.0

* Deprecated `-[XCDYouTubeVideo thumbnailURL]` use `-[XCDYouTubeVideo thumbnailURLs]` (#477)
* Exclude plist files from Swift Package Manager (#478)
* Annotate `languageIdentifier` argument as `nullable` in `XCDYouTubeVideoOperation`
* Add new `author`, `videoDescription` and `channelIdentifier` properties to `XCDYouTubeVideo` (#471)

#### Version 2.12.0

* Add the ability to specify which `streamURLs` to query via `-[XCDYouTubeClient queryVideo:video:streamURLsToQuery:options:cookies:completionHandler:]` & `XCDYouTubeVideoQueryOperation` class.
Expand Down
5 changes: 5 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ let package = Package(
.target(
name: "XCDYouTubeKit",
path: ".",
exclude: [
"XCDYouTubeKit/Info.plist",
"XCDYouTubeKit/Configuration.plist",
"XCDYouTubeKit/AppledocSettings.plist"
],
sources: ["XCDYouTubeKit"],
publicHeadersPath: "XCDYouTubeKit"
)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ XCDYouTubeKit is available through [CocoaPods](https://cocoapods.org/), [Carthag
CocoaPods:

```ruby
pod "XCDYouTubeKit", "~> 2.12"
pod "XCDYouTubeKit", "~> 2.13"
```

Carthage:

```objc
github "0xced/XCDYouTubeKit" ~> 2.12
github "0xced/XCDYouTubeKit" ~> 2.13
```

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

```swift
dependencies: [
.package(url: "https://github.com/0xced/XCDYouTubeKit.git", from: "2.12.0")
.package(url: "https://github.com/0xced/XCDYouTubeKit.git", from: "2.13.0")
]
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2.12.0;
CURRENT_PROJECT_VERSION = 2.13.0;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
Expand Down Expand Up @@ -804,7 +804,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 2.12.0;
CURRENT_PROJECT_VERSION = 2.13.0;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down

Large diffs are not rendered by default.

45 changes: 39 additions & 6 deletions XCDYouTubeKit Tests/XCDYouTubeClientTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
//

#import "XCDYouTubeKitTestCase.h"

#if TARGET_OS_OSX
#import <AppKit/NSImage.h>
#endif
#import <XCDYouTubeKit/XCDYouTubeClient.h>
#import <XCDYouTubeKit/XCDYouTubeVideoOperation.h>

Expand Down Expand Up @@ -32,14 +34,45 @@ - (void) testThatVideoHasMetadata
XCTAssertNil(error);
XCTAssertEqualObjects(video.identifier, @"9TTioMbNT9I");
XCTAssertEqualObjects(video.title, @"Super Mario Bros Theme Song on Wine Glasses and a Frying Pan (슈퍼 마리오 브라더스 - スーパーマリオブラザーズ - 超級瑪莉)");
XCTAssertNotNil(video.thumbnailURL);
XCTAssertEqualObjects(video.author, @"Dan Newbie");
XCTAssertEqualObjects(video.channelIdentifier, @"UCxjo61fSS-hR7RiyBxnnHdg");
XCTAssertNotEqualObjects(video.videoDescription, @"");
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:5 handler:nil];
}
#if TARGET_OS_OSX
- (void) testThatThumbnailsAreOrderedCorrectly
{
__weak XCTestExpectation *expectation = [self expectationWithDescription:@""];
[[XCDYouTubeClient defaultClient] getVideoWithIdentifier:@"9TTioMbNT9I" completionHandler:^(XCDYouTubeVideo *video, NSError *error)
{
XCTAssertNil(error);
XCTAssertNotNil(video.thumbnailURLs);
XCTAssertNotEqual(video.thumbnailURLs.count, 0);

NSMutableArray<NSImage *>*thumbnailImages = [NSMutableArray new];

for (NSURL *thumbnailURL in video.thumbnailURLs)
{
[thumbnailImages addObject:[[NSImage alloc]initWithContentsOfURL:thumbnailURL]];
}

[thumbnailImages sortUsingComparator:^NSComparisonResult(NSImage * _Nonnull image1, NSImage * _Nonnull image2)
{
BOOL isSmaller = image1.size.width < image2.size.width && image1.size.height < image2.size.height;
XCTAssertTrue(isSmaller, @"`thumbnailURLs` should be ordered from smallest to largest");
return isSmaller;
}];

[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:5 handler:nil];
}
#endif
- (void) testThatVideoHasOtherStreams
{
__weak XCTestExpectation *expectation = [self expectationWithDescription:@""];
Expand Down Expand Up @@ -141,7 +174,7 @@ - (void) testMobileRestrictedVideo
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
[video.streamURLs enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSURL *streamURL, BOOL *stop) {
Expand All @@ -160,7 +193,7 @@ - (void) testLiveVideo
XCTAssertNil(error);
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertNotNil(video.streamURLs[XCDYouTubeVideoQualityHTTPLiveStreaming]);
[expectation fulfill];
}];
Expand All @@ -177,7 +210,7 @@ - (void) testVideo1
XCTAssertNil(error);
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
[video.streamURLs enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSURL *streamURL, BOOL *stop) {
Expand All @@ -199,7 +232,7 @@ - (void) testVideo1IsPlayable
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:video.streamURLs[@(XCDYouTubeVideoQualityMedium360)]];
Expand Down
30 changes: 15 additions & 15 deletions XCDYouTubeKit Tests/XCDYouTubeProtectedVideosTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ - (void) testAgeRestrictedVideoThatRequiresCookiesWithUserCookies
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
[video.streamURLs enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSURL *streamURL, BOOL *stop)
Expand All @@ -74,7 +74,7 @@ - (void) testAgeRestrictedVideoThatRequiresCookiesWithUserCookiesIsPlayable
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:video.streamURLs[@(XCDYouTubeVideoQualityMedium360)]];
Expand Down Expand Up @@ -113,7 +113,7 @@ - (void) testAgeRestrictedVideo
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
[video.streamURLs enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSURL *streamURL, BOOL *stop)
Expand All @@ -134,7 +134,7 @@ - (void) testAgeRestrictedUnratedVideo
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
[video.streamURLs enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSURL *streamURL, BOOL *stop)
Expand Down Expand Up @@ -170,7 +170,7 @@ - (void) testProtectedVEVOVideoWithNilCustomPatternIsPlayable
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:video.streamURLs[@(XCDYouTubeVideoQualityMedium360)]];
Expand All @@ -196,7 +196,7 @@ - (void) testProtectedVEVOVideoWithEmptyCustomPatternIsPlayable
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:video.streamURLs[@(XCDYouTubeVideoQualityMedium360)]];
Expand All @@ -222,7 +222,7 @@ - (void) testProtectedVEVOVideoWithInvalidCustomPatternIsPlayable
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:video.streamURLs[@(XCDYouTubeVideoQualityMedium360)]];
Expand All @@ -248,7 +248,7 @@ - (void) testProtectedVEVOVideoWithValidCustomPatternIsPlayable
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:video.streamURLs[@(XCDYouTubeVideoQualityMedium360)]];
Expand All @@ -272,7 +272,7 @@ - (void) testProtectedVEVOVideo1
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
[video.streamURLs enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSURL *streamURL, BOOL *stop)
Expand All @@ -293,7 +293,7 @@ - (void) testProtectedVEVOVideo2
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
[video.streamURLs enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSURL *streamURL, BOOL *stop)
Expand All @@ -314,7 +314,7 @@ - (void) testProtectedVEVOVideo3
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
[video.streamURLs enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSURL *streamURL, BOOL *stop)
Expand All @@ -335,7 +335,7 @@ - (void) testProtectedVEVOIsPlayable
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:video.streamURLs[@(XCDYouTubeVideoQualityMedium360)]];
Expand Down Expand Up @@ -378,7 +378,7 @@ - (void) testAgeRestrictedVEVOVideoWithUserCookies
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
[video.streamURLs enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSURL *streamURL, BOOL *stop)
Expand All @@ -400,7 +400,7 @@ - (void) testAgeRestrictedVEVOVideoWithUserCookiesIsPlayable
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:video.streamURLs[@(XCDYouTubeVideoQualityMedium360)]];
Expand Down Expand Up @@ -539,7 +539,7 @@ - (void) testAgeRestrictedVideo1
XCTAssertNotNil(video.title);
XCTAssertTrue(video.viewCount > 0);
XCTAssertNotNil(video.expirationDate);
XCTAssertNotNil(video.thumbnailURL);
XCTAssertNotNil(video.thumbnailURLs.firstObject);
XCTAssertTrue(video.streamURLs.count > 0);
XCTAssertTrue(video.duration > 0);
[video.streamURLs enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSURL *streamURL, BOOL *stop)
Expand Down
2 changes: 1 addition & 1 deletion XCDYouTubeKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "XCDYouTubeKit"
s.version = "2.12.0"
s.version = "2.13.0"
s.summary = "YouTube video player for iOS and OS X."
s.homepage = "https://github.com/0xced/XCDYouTubeKit"
s.screenshot = "https://raw.github.com/0xced/XCDYouTubeKit/#{s.version}/Screenshots/XCDYouTubeVideoPlayerViewController.png"
Expand Down
22 changes: 18 additions & 4 deletions XCDYouTubeKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
012718E72457786400123A28 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
017234C023FC223D00196707 /* XCDURLGETOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCDURLGETOperation.h; sourceTree = "<group>"; };
017234C123FC223D00196707 /* XCDURLGETOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCDURLGETOperation.m; sourceTree = "<group>"; };
0178E76B23F49BBC001C382E /* XCDYouTubeVideoQueryOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCDYouTubeVideoQueryOperation.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -187,6 +188,14 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
012718E62457786300123A28 /* Frameworks */ = {
isa = PBXGroup;
children = (
012718E72457786400123A28 /* AppKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
C20F57A118817D5400EDBFB0 /* XCDYouTubeKit Tests */ = {
isa = PBXGroup;
children = (
Expand All @@ -212,6 +221,7 @@
C2A3F2D217F4827800AC1C3B /* XCDYouTubeKit */,
C20F57A118817D5400EDBFB0 /* XCDYouTubeKit Tests */,
C2A3F2CE17F4827800AC1C3B /* Products */,
012718E62457786300123A28 /* Frameworks */,
);
indentWidth = 4;
sourceTree = "<group>";
Expand Down Expand Up @@ -587,6 +597,8 @@
"OTHER_LDFLAGS[sdk=macosx*]" = (
"-framework",
CoreServices,
"-framework",
AppKit,
);
WARNING_CFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -620,6 +632,8 @@
"OTHER_LDFLAGS[sdk=macosx*]" = (
"-framework",
CoreServices,
"-framework",
AppKit,
);
WARNING_CFLAGS = (
"$(inherited)",
Expand Down Expand Up @@ -649,10 +663,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 46;
CURRENT_PROJECT_VERSION = 47;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 2.0.0;
DYLIB_CURRENT_VERSION = 2.12.0;
DYLIB_CURRENT_VERSION = 2.13.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -727,10 +741,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 46;
CURRENT_PROJECT_VERSION = 47;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 2.0.0;
DYLIB_CURRENT_VERSION = 2.12.0;
DYLIB_CURRENT_VERSION = 2.13.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down
Loading

0 comments on commit d6f4b0e

Please sign in to comment.