Skip to content

Commit

Permalink
Merge branch 'hotfix/1.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
0xced committed Feb 28, 2014
2 parents c53666a + d1ad3c4 commit 5dded8e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#### Version 1.1.2

* Adaptation to YouTube API change. (#19)

#### Version 1.1.1

* For errors of the `XCDYouTubeVideoErrorDomain` domain, `-[NSError localizedDescription]` is actually localized and doesn’t contain HTML tags, making it suitable for displaying to the user.
Expand Down
2 changes: 1 addition & 1 deletion XCDYouTubeVideoPlayerViewController.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "XCDYouTubeVideoPlayerViewController"
s.version = "1.1.1"
s.version = "1.1.2"
s.summary = "YouTube video player for iPhone and iPad."
s.homepage = "https://github.com/0xced/XCDYouTubeVideoPlayerViewController"
s.license = 'MIT'
Expand Down
4 changes: 2 additions & 2 deletions XCDYouTubeVideoPlayerViewController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
COPY_PHASE_STRIP = NO;
DYLIB_COMPATIBILITY_VERSION = 1.1.1;
DYLIB_COMPATIBILITY_VERSION = 1.1.2;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
Expand Down Expand Up @@ -199,7 +199,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1.1.1;
DYLIB_COMPATIBILITY_VERSION = 1.1.2;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,24 @@ - (NSURL *) videoURLWithData:(NSData *)data error:(NSError * __autoreleasing *)e
NSString *videoQuery = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
NSStringEncoding queryEncoding = NSUTF8StringEncoding;
NSDictionary *video = DictionaryWithQueryString(videoQuery, queryEncoding);
NSArray *streamQueries = [video[@"url_encoded_fmt_stream_map"] componentsSeparatedByString:@","];
NSMutableArray *streamQueries = [[video[@"url_encoded_fmt_stream_map"] componentsSeparatedByString:@","] mutableCopy];
[streamQueries addObjectsFromArray:[video[@"adaptive_fmts"] componentsSeparatedByString:@","]];

NSMutableDictionary *streamURLs = [NSMutableDictionary new];
for (NSString *streamQuery in streamQueries)
{
NSDictionary *stream = DictionaryWithQueryString(streamQuery, queryEncoding);
NSString *type = stream[@"type"];
NSString *urlString = stream[@"url"];
NSString *signature = stream[@"sig"];
if (urlString && signature && [AVURLAsset isPlayableExtendedMIMEType:type])
if (urlString && [AVURLAsset isPlayableExtendedMIMEType:type])
{
NSURL *streamURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@&signature=%@", urlString, signature]];
streamURLs[@([stream[@"itag"] integerValue])] = streamURL;
NSURL *streamURL = [NSURL URLWithString:urlString];
NSString *signature = stream[@"sig"];
if (signature)
streamURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@&signature=%@", urlString, signature]];

if ([[DictionaryWithQueryString(streamURL.query, queryEncoding) allKeys] containsObject:@"signature"])
streamURLs[@([stream[@"itag"] integerValue])] = streamURL;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.1</string>
<string>1.1.2</string>
<key>CFBundleVersion</key>
<string>0</string>
<key>LSRequiresIPhoneOS</key>
Expand Down

0 comments on commit 5dded8e

Please sign in to comment.