diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..caccbc0fe --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,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. +* Setting the `preferredVideoQualities` property to nil restores its default values. +* Added some documentation in the XCDYouTubeVideoPlayerViewController header file. +* XCDYouTubeVideoPlayerViewController is built as a static library. +* Better demo project with one feature illustrated per view controller. +* iOS 7 compatible demo project. + +#### Version 1.1.0 + +* Video metadata information (thumbnails and title) is provided through `XCDYouTubeVideoPlayerViewControllerDidReceiveMetadataNotification`. (#1) +* Workaround a case where the status bar could disappear after the video ends playback. (#3) +* Error reporting is more accurate, especially for VEVO videos. (#6) +* `prepareToPlay` is not automatically called, it’s the programmer responsibility to call it if appropriate. + +#### Version 1.0 + +* Initial version diff --git a/README.md b/README.md index 948739abb..91dfedb82 100644 --- a/README.md +++ b/README.md @@ -37,25 +37,12 @@ XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVid [self presentMoviePlayerViewControllerAnimated:videoPlayerViewController]; ``` -#### Fetch the video identifier asynchronously - -```objc -XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [XCDYouTubeVideoPlayerViewController new]; -[self presentMoviePlayerViewControllerAnimated:videoPlayerViewController]; - -NSURL *url = [NSURL URLWithString:@"https://gdata.youtube.com/feeds/api/standardfeeds/on_the_web?v=2&alt=json&max-results=1"]; -[NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:url] queue:[NSOperationQueue new] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { - id json = [NSJSONSerialization JSONObjectWithData:data ?: [NSData new] options:0 error:NULL]; - NSString *videoIdentifier = [[[json valueForKeyPath:@"feed.entry.media$group.yt$videoid.$t"] lastObject] description]; - videoPlayerViewController.videoIdentifier = videoIdentifier; -}]; -``` - #### Present the video in a non full-screen view ```objc XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:@"9bZkp7q19f0"]; [videoPlayerViewController presentInView:self.videoContainerView]; +[videoPlayerViewController.moviePlayer play]; ``` See the demo project for more sample code. diff --git a/Screenshots/XCDYouTubeVideoPlayerViewController.png b/Screenshots/XCDYouTubeVideoPlayerViewController.png index 9104a5932..b5140261b 100644 Binary files a/Screenshots/XCDYouTubeVideoPlayerViewController.png and b/Screenshots/XCDYouTubeVideoPlayerViewController.png differ diff --git a/XCDYouTubeVideoPlayerViewController.podspec b/XCDYouTubeVideoPlayerViewController.podspec index d50de6424..9a92b4b8f 100644 --- a/XCDYouTubeVideoPlayerViewController.podspec +++ b/XCDYouTubeVideoPlayerViewController.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = "XCDYouTubeVideoPlayerViewController" - s.version = "1.1.0" + s.version = "1.1.1" s.summary = "YouTube video player for iPhone and iPad." s.homepage = "https://github.com/0xced/XCDYouTubeVideoPlayerViewController" s.license = 'MIT' s.author = { "Cédric Luthi" => "cedric.luthi@gmail.com" } - s.source = { :git => "https://github.com/0xced/XCDYouTubeVideoPlayerViewController.git", :tag => "1.1.0" } + s.source = { :git => "https://github.com/0xced/XCDYouTubeVideoPlayerViewController.git", :tag => s.version.to_s } s.platform = :ios, '5.0' s.source_files = 'XCDYouTubeVideoPlayerViewController' s.frameworks = 'AVFoundation', 'MediaPlayer' diff --git a/XCDYouTubeVideoPlayerViewController.xcodeproj/project.pbxproj b/XCDYouTubeVideoPlayerViewController.xcodeproj/project.pbxproj new file mode 100644 index 000000000..bfbb87cf5 --- /dev/null +++ b/XCDYouTubeVideoPlayerViewController.xcodeproj/project.pbxproj @@ -0,0 +1,269 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + C274158D17F48B100026834B /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C274158717F48AD10026834B /* AVFoundation.framework */; }; + C274158E17F48B100026834B /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C274158817F48AD10026834B /* MediaPlayer.framework */; }; + C274158F17F48B100026834B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C274158917F48AD10026834B /* UIKit.framework */; }; + C2A3F2D617F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.h in Copy Files */ = {isa = PBXBuildFile; fileRef = C2A3F2D517F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.h */; }; + C2A3F2D817F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C2A3F2D717F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + C2A3F2CB17F4827800AC1C3B /* Copy Files */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 12; + dstPath = "include/${PRODUCT_NAME}"; + dstSubfolderSpec = 16; + files = ( + C2A3F2D617F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.h in Copy Files */, + ); + name = "Copy Files"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + C274158717F48AD10026834B /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + C274158817F48AD10026834B /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; + C274158917F48AD10026834B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + C2A3F2CD17F4827800AC1C3B /* libXCDYouTubeVideoPlayerViewController.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libXCDYouTubeVideoPlayerViewController.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C2A3F2D517F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCDYouTubeVideoPlayerViewController.h; sourceTree = ""; }; + C2A3F2D717F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCDYouTubeVideoPlayerViewController.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + C2A3F2CA17F4827800AC1C3B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C274158D17F48B100026834B /* AVFoundation.framework in Frameworks */, + C274158E17F48B100026834B /* MediaPlayer.framework in Frameworks */, + C274158F17F48B100026834B /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + C2A3F2C417F4827800AC1C3B = { + isa = PBXGroup; + children = ( + C2A3F2D217F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController */, + C2A3F2CF17F4827800AC1C3B /* Frameworks */, + C2A3F2CE17F4827800AC1C3B /* Products */, + ); + sourceTree = ""; + }; + C2A3F2CE17F4827800AC1C3B /* Products */ = { + isa = PBXGroup; + children = ( + C2A3F2CD17F4827800AC1C3B /* libXCDYouTubeVideoPlayerViewController.a */, + ); + name = Products; + sourceTree = ""; + }; + C2A3F2CF17F4827800AC1C3B /* Frameworks */ = { + isa = PBXGroup; + children = ( + C274158717F48AD10026834B /* AVFoundation.framework */, + C274158817F48AD10026834B /* MediaPlayer.framework */, + C274158917F48AD10026834B /* UIKit.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + C2A3F2D217F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController */ = { + isa = PBXGroup; + children = ( + C2A3F2D517F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.h */, + C2A3F2D717F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.m */, + ); + path = XCDYouTubeVideoPlayerViewController; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C2A3F2CC17F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController */ = { + isa = PBXNativeTarget; + buildConfigurationList = C2A3F2DB17F4827800AC1C3B /* Build configuration list for PBXNativeTarget "XCDYouTubeVideoPlayerViewController" */; + buildPhases = ( + C2A3F2C917F4827800AC1C3B /* Sources */, + C2A3F2CA17F4827800AC1C3B /* Frameworks */, + C2A3F2CB17F4827800AC1C3B /* Copy Files */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = XCDYouTubeVideoPlayerViewController; + productName = XCDYouTubeVideoPlayerViewController; + productReference = C2A3F2CD17F4827800AC1C3B /* libXCDYouTubeVideoPlayerViewController.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C2A3F2C517F4827800AC1C3B /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0460; + ORGANIZATIONNAME = "Cédric Luthi"; + }; + buildConfigurationList = C2A3F2C817F4827800AC1C3B /* Build configuration list for PBXProject "XCDYouTubeVideoPlayerViewController" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = C2A3F2C417F4827800AC1C3B; + productRefGroup = C2A3F2CE17F4827800AC1C3B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C2A3F2CC17F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + C2A3F2C917F4827800AC1C3B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C2A3F2D817F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + C2A3F2D917F4827800AC1C3B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + COPY_PHASE_STRIP = NO; + DYLIB_COMPATIBILITY_VERSION = 1.1.1; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_SHADOW = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + WARNING_CFLAGS = ( + "-Weverything", + "-Wno-gnu", + "-Wno-objc-missing-property-synthesis", + "-Wno-pedantic", + "-Wno-unused-parameter", + ); + }; + name = Debug; + }; + C2A3F2DA17F4827800AC1C3B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + COPY_PHASE_STRIP = YES; + DYLIB_COMPATIBILITY_VERSION = 1.1.1; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_SHADOW = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + WARNING_CFLAGS = ( + "-Weverything", + "-Wno-gnu", + "-Wno-objc-missing-property-synthesis", + "-Wno-pedantic", + "-Wno-unused-parameter", + ); + }; + name = Release; + }; + C2A3F2DC17F4827800AC1C3B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + C2A3F2DD17F4827800AC1C3B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C2A3F2C817F4827800AC1C3B /* Build configuration list for PBXProject "XCDYouTubeVideoPlayerViewController" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C2A3F2D917F4827800AC1C3B /* Debug */, + C2A3F2DA17F4827800AC1C3B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C2A3F2DB17F4827800AC1C3B /* Build configuration list for PBXNativeTarget "XCDYouTubeVideoPlayerViewController" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C2A3F2DC17F4827800AC1C3B /* Debug */, + C2A3F2DD17F4827800AC1C3B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = C2A3F2C517F4827800AC1C3B /* Project object */; +} diff --git a/XCDYouTubeVideoPlayerViewController.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/XCDYouTubeVideoPlayerViewController.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..35c7e5698 --- /dev/null +++ b/XCDYouTubeVideoPlayerViewController.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/XCDYouTubeVideoPlayerViewController/XCDYouTubeVideoPlayerViewController.h b/XCDYouTubeVideoPlayerViewController/XCDYouTubeVideoPlayerViewController.h index 76d937084..9042dd548 100644 --- a/XCDYouTubeVideoPlayerViewController/XCDYouTubeVideoPlayerViewController.h +++ b/XCDYouTubeVideoPlayerViewController/XCDYouTubeVideoPlayerViewController.h @@ -1,6 +1,6 @@ // // XCDYouTubeVideoPlayerViewController.h -// YouTube Video Player Demo +// XCDYouTubeVideoPlayerViewController // // Created by Cédric Luthi on 02.05.13. // Copyright (c) 2013 Cédric Luthi. All rights reserved. @@ -16,12 +16,12 @@ typedef NS_ENUM(NSUInteger, XCDYouTubeVideoQuality) { }; MP_EXTERN NSString *const XCDYouTubeVideoErrorDomain; -MP_EXTERN NSString *const XCDMoviePlayerPlaybackDidFinishErrorUserInfoKey; // NSError +MP_EXTERN NSString *const XCDMoviePlayerPlaybackDidFinishErrorUserInfoKey; // NSError key for the `MPMoviePlayerPlaybackDidFinishNotification` userInfo dictionary enum { - XCDYouTubeErrorInvalidVideoIdentifier = 2, - XCDYouTubeErrorRemovedVideo = 100, - XCDYouTubeErrorRestrictedPlayback = 150 + XCDYouTubeErrorInvalidVideoIdentifier = 2, // The given `videoIdentifier` string is invalid (including `nil`) + XCDYouTubeErrorRemovedVideo = 100, // The video has been removed as a violation of YouTube's policy + XCDYouTubeErrorRestrictedPlayback = 150 // The video is not playable because of legal reasons or the this is a private video }; MP_EXTERN NSString *const XCDYouTubeVideoPlayerViewControllerDidReceiveMetadataNotification; @@ -40,6 +40,7 @@ MP_EXTERN NSString *const XCDMetadataKeyLargeThumbnailURL; // On iPhone, defaults to @[ @(XCDYouTubeVideoQualityHD720), @(XCDYouTubeVideoQualityMedium360), @(XCDYouTubeVideoQualitySmall240) ] // On iPad, defaults to @[ @(XCDYouTubeVideoQualityHD1080), @(XCDYouTubeVideoQualityHD720), @(XCDYouTubeVideoQualityMedium360), @(XCDYouTubeVideoQualitySmall240) ] // If you really know what you are doing, you can use the `itag` values as described on http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs +// Setting this property to nil restores its default values @property (nonatomic, copy) NSArray *preferredVideoQualities; // Ownership of the XCDYouTubeVideoPlayerViewController instance is transferred to the view. diff --git a/XCDYouTubeVideoPlayerViewController/XCDYouTubeVideoPlayerViewController.m b/XCDYouTubeVideoPlayerViewController/XCDYouTubeVideoPlayerViewController.m index 36dfc239f..f95de8ed7 100644 --- a/XCDYouTubeVideoPlayerViewController/XCDYouTubeVideoPlayerViewController.m +++ b/XCDYouTubeVideoPlayerViewController/XCDYouTubeVideoPlayerViewController.m @@ -1,6 +1,6 @@ // // XCDYouTubeVideoPlayerViewController.m -// YouTube Video Player Demo +// XCDYouTubeVideoPlayerViewController // // Created by Cédric Luthi on 02.05.13. // Copyright (c) 2013 Cédric Luthi. All rights reserved. @@ -38,6 +38,19 @@ return dictionary; } +static NSString *ApplicationLanguageIdentifier(void) +{ + static NSString *applicationLanguageIdentifier; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + applicationLanguageIdentifier = @"en"; + NSArray *preferredLocalizations = [[NSBundle mainBundle] preferredLocalizations]; + if (preferredLocalizations.count > 0) + applicationLanguageIdentifier = [NSLocale canonicalLanguageIdentifierFromString:preferredLocalizations[0]] ?: applicationLanguageIdentifier; + }); + return applicationLanguageIdentifier; +} + @interface XCDYouTubeVideoPlayerViewController () @property (nonatomic, strong) NSURLConnection *connection; @property (nonatomic, strong) NSMutableData *connectionData; @@ -66,10 +79,7 @@ - (id) initWithVideoIdentifier:(NSString *)videoIdentifier if (!(self = [super init])) return nil; - if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) - _preferredVideoQualities = @[ @(XCDYouTubeVideoQualityHD720), @(XCDYouTubeVideoQualityMedium360), @(XCDYouTubeVideoQualitySmall240) ]; - else - _preferredVideoQualities = @[ @(XCDYouTubeVideoQualityHD1080), @(XCDYouTubeVideoQualityHD720), @(XCDYouTubeVideoQualityMedium360), @(XCDYouTubeVideoQualitySmall240) ]; + self.preferredVideoQualities = nil; if (videoIdentifier) self.videoIdentifier = videoIdentifier; @@ -103,6 +113,21 @@ - (void) setVideoIdentifier:(NSString *)videoIdentifier [self startVideoInfoRequest]; } +- (void) setPreferredVideoQualities:(NSArray *)preferredVideoQualities +{ + if (preferredVideoQualities) + { + _preferredVideoQualities = [preferredVideoQualities copy]; + } + else + { + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) + _preferredVideoQualities = @[ @(XCDYouTubeVideoQualityHD720), @(XCDYouTubeVideoQualityMedium360), @(XCDYouTubeVideoQualitySmall240) ]; + else + _preferredVideoQualities = @[ @(XCDYouTubeVideoQualityHD1080), @(XCDYouTubeVideoQualityHD720), @(XCDYouTubeVideoQualityMedium360), @(XCDYouTubeVideoQualitySmall240) ]; + } +} + - (void) presentInView:(UIView *)view { self.embedded = YES; @@ -122,8 +147,9 @@ - (void) startVideoInfoRequest if (elField.length > 0) elField = [@"&el=" stringByAppendingString:elField]; - NSURL *videoInfoURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://www.youtube.com/get_video_info?video_id=%@%@&ps=default&eurl=&gl=US&hl=en", self.videoIdentifier ?: @"", elField]]; - NSURLRequest *request = [[NSURLRequest alloc] initWithURL:videoInfoURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10]; + NSURL *videoInfoURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://www.youtube.com/get_video_info?video_id=%@%@&ps=default&eurl=&gl=US&hl=%@", self.videoIdentifier ?: @"", elField, ApplicationLanguageIdentifier()]]; + NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:videoInfoURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10]; + [request setValue:ApplicationLanguageIdentifier() forHTTPHeaderField:@"Accept-Language"]; [self.connection cancel]; self.connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; } @@ -167,7 +193,7 @@ - (void) viewWillDisappear:(BOOL)animated - (void) connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { - NSUInteger capacity = response.expectedContentLength == NSURLResponseUnknownLength ? 0 : response.expectedContentLength; + NSUInteger capacity = response.expectedContentLength == NSURLResponseUnknownLength ? 0 : (NSUInteger)response.expectedContentLength; self.connectionData = [[NSMutableData alloc] initWithCapacity:capacity]; } @@ -211,7 +237,7 @@ - (void) moviePlayerWillExitFullscreen:(NSNotification *)notification #pragma mark - URL Parsing -- (NSURL *) videoURLWithData:(NSData *)data error:(NSError **)error +- (NSURL *) videoURLWithData:(NSData *)data error:(NSError * __autoreleasing *)error { NSString *videoQuery = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; NSStringEncoding queryEncoding = NSUTF8StringEncoding; @@ -261,7 +287,14 @@ - (NSURL *) videoURLWithData:(NSData *)data error:(NSError **)error NSMutableDictionary *userInfo = [@{ NSURLErrorKey: self.connection.originalRequest.URL } mutableCopy]; NSString *reason = video[@"reason"]; if (reason) + { + reason = [reason stringByReplacingOccurrencesOfString:@"" withString:@" " options:NSRegularExpressionSearch range:NSMakeRange(0, reason.length)]; + NSRange range; + while ((range = [reason rangeOfString:@"<[^>]+>" options:NSRegularExpressionSearch]).location != NSNotFound) + reason = [reason stringByReplacingCharactersInRange:range withString:@""]; + userInfo[NSLocalizedDescriptionKey] = reason; + } NSInteger code = [video[@"errorcode"] integerValue]; *error = [NSError errorWithDomain:XCDYouTubeVideoErrorDomain code:code userInfo:userInfo]; diff --git a/YouTube Video Player Demo.xcodeproj/project.pbxproj b/YouTube Video Player Demo.xcodeproj/project.pbxproj deleted file mode 100644 index 6eddd6fec..000000000 --- a/YouTube Video Player Demo.xcodeproj/project.pbxproj +++ /dev/null @@ -1,310 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - C261FBDD17444FF2005FDFCA /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C261FBDC17444FF2005FDFCA /* AVFoundation.framework */; }; - C285F6D717324F7500D81C59 /* DemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C285F6D617324F7500D81C59 /* DemoViewController.xib */; }; - C285F6DC1732522300D81C59 /* XCDYouTubeVideoPlayerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C285F6DB1732522300D81C59 /* XCDYouTubeVideoPlayerViewController.m */; }; - C285F6DE1732523400D81C59 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C285F6DD1732523400D81C59 /* MediaPlayer.framework */; }; - C29CC80D17324DD400581C7C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C29CC80C17324DD400581C7C /* UIKit.framework */; }; - C29CC80F17324DD400581C7C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C29CC80E17324DD400581C7C /* Foundation.framework */; }; - C29CC81917324DD400581C7C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C29CC81817324DD400581C7C /* main.m */; }; - C29CC81D17324DD400581C7C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C29CC81C17324DD400581C7C /* AppDelegate.m */; }; - C29CC81F17324DD400581C7C /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = C29CC81E17324DD400581C7C /* Default.png */; }; - C29CC82117324DD500581C7C /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C29CC82017324DD500581C7C /* Default@2x.png */; }; - C29CC82317324DD500581C7C /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C29CC82217324DD500581C7C /* Default-568h@2x.png */; }; - C29CC82617324DD500581C7C /* DemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C29CC82517324DD500581C7C /* DemoViewController.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - C261FBDC17444FF2005FDFCA /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; - C285F6D617324F7500D81C59 /* DemoViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DemoViewController.xib; sourceTree = ""; }; - C285F6DA1732522300D81C59 /* XCDYouTubeVideoPlayerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCDYouTubeVideoPlayerViewController.h; sourceTree = ""; }; - C285F6DB1732522300D81C59 /* XCDYouTubeVideoPlayerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCDYouTubeVideoPlayerViewController.m; sourceTree = ""; }; - C285F6DD1732523400D81C59 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; - C29CC80917324DD400581C7C /* YouTube Video Player Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "YouTube Video Player Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - C29CC80C17324DD400581C7C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - C29CC80E17324DD400581C7C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - C29CC81417324DD400581C7C /* YouTube Video Player Demo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "YouTube Video Player Demo-Info.plist"; sourceTree = ""; }; - C29CC81817324DD400581C7C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - C29CC81A17324DD400581C7C /* YouTube Video Player Demo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "YouTube Video Player Demo-Prefix.pch"; sourceTree = ""; }; - C29CC81B17324DD400581C7C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - C29CC81C17324DD400581C7C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - C29CC81E17324DD400581C7C /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; - C29CC82017324DD500581C7C /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; - C29CC82217324DD500581C7C /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; - C29CC82417324DD500581C7C /* DemoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DemoViewController.h; sourceTree = ""; }; - C29CC82517324DD500581C7C /* DemoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoViewController.m; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - C29CC80617324DD400581C7C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - C29CC80D17324DD400581C7C /* UIKit.framework in Frameworks */, - C29CC80F17324DD400581C7C /* Foundation.framework in Frameworks */, - C285F6DE1732523400D81C59 /* MediaPlayer.framework in Frameworks */, - C261FBDD17444FF2005FDFCA /* AVFoundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - C285F6D91732520500D81C59 /* XCDYouTubeVideoPlayerViewController */ = { - isa = PBXGroup; - children = ( - C285F6DA1732522300D81C59 /* XCDYouTubeVideoPlayerViewController.h */, - C285F6DB1732522300D81C59 /* XCDYouTubeVideoPlayerViewController.m */, - ); - path = XCDYouTubeVideoPlayerViewController; - sourceTree = ""; - }; - C29CC80017324DD400581C7C = { - isa = PBXGroup; - children = ( - C285F6D91732520500D81C59 /* XCDYouTubeVideoPlayerViewController */, - C29CC81217324DD400581C7C /* YouTube Video Player Demo */, - C29CC80B17324DD400581C7C /* Frameworks */, - C29CC80A17324DD400581C7C /* Products */, - ); - indentWidth = 4; - sourceTree = ""; - tabWidth = 4; - usesTabs = 1; - }; - C29CC80A17324DD400581C7C /* Products */ = { - isa = PBXGroup; - children = ( - C29CC80917324DD400581C7C /* YouTube Video Player Demo.app */, - ); - name = Products; - sourceTree = ""; - }; - C29CC80B17324DD400581C7C /* Frameworks */ = { - isa = PBXGroup; - children = ( - C261FBDC17444FF2005FDFCA /* AVFoundation.framework */, - C29CC80E17324DD400581C7C /* Foundation.framework */, - C285F6DD1732523400D81C59 /* MediaPlayer.framework */, - C29CC80C17324DD400581C7C /* UIKit.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - C29CC81217324DD400581C7C /* YouTube Video Player Demo */ = { - isa = PBXGroup; - children = ( - C29CC81B17324DD400581C7C /* AppDelegate.h */, - C29CC81C17324DD400581C7C /* AppDelegate.m */, - C29CC82417324DD500581C7C /* DemoViewController.h */, - C29CC82517324DD500581C7C /* DemoViewController.m */, - C285F6D617324F7500D81C59 /* DemoViewController.xib */, - C29CC81317324DD400581C7C /* Supporting Files */, - ); - path = "YouTube Video Player Demo"; - sourceTree = ""; - }; - C29CC81317324DD400581C7C /* Supporting Files */ = { - isa = PBXGroup; - children = ( - C29CC81417324DD400581C7C /* YouTube Video Player Demo-Info.plist */, - C29CC81817324DD400581C7C /* main.m */, - C29CC81A17324DD400581C7C /* YouTube Video Player Demo-Prefix.pch */, - C29CC81E17324DD400581C7C /* Default.png */, - C29CC82017324DD500581C7C /* Default@2x.png */, - C29CC82217324DD500581C7C /* Default-568h@2x.png */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - C29CC80817324DD400581C7C /* YouTube Video Player Demo */ = { - isa = PBXNativeTarget; - buildConfigurationList = C29CC82F17324DD500581C7C /* Build configuration list for PBXNativeTarget "YouTube Video Player Demo" */; - buildPhases = ( - C29CC80517324DD400581C7C /* Sources */, - C29CC80617324DD400581C7C /* Frameworks */, - C29CC80717324DD400581C7C /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "YouTube Video Player Demo"; - productName = "YouTube Video Player Demo"; - productReference = C29CC80917324DD400581C7C /* YouTube Video Player Demo.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - C29CC80117324DD400581C7C /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - ORGANIZATIONNAME = "Cédric Luthi"; - }; - buildConfigurationList = C29CC80417324DD400581C7C /* Build configuration list for PBXProject "YouTube Video Player Demo" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = C29CC80017324DD400581C7C; - productRefGroup = C29CC80A17324DD400581C7C /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - C29CC80817324DD400581C7C /* YouTube Video Player Demo */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - C29CC80717324DD400581C7C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C29CC81F17324DD400581C7C /* Default.png in Resources */, - C29CC82117324DD500581C7C /* Default@2x.png in Resources */, - C29CC82317324DD500581C7C /* Default-568h@2x.png in Resources */, - C285F6D717324F7500D81C59 /* DemoViewController.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - C29CC80517324DD400581C7C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C29CC81917324DD400581C7C /* main.m in Sources */, - C29CC81D17324DD400581C7C /* AppDelegate.m in Sources */, - C29CC82617324DD500581C7C /* DemoViewController.m in Sources */, - C285F6DC1732522300D81C59 /* XCDYouTubeVideoPlayerViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - C29CC82D17324DD500581C7C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 2; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - C29CC82E17324DD500581C7C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 2; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = "NS_BLOCK_ASSERTIONS=1"; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; - C29CC83017324DD500581C7C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "YouTube Video Player Demo/YouTube Video Player Demo-Prefix.pch"; - INFOPLIST_FILE = "YouTube Video Player Demo/YouTube Video Player Demo-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - C29CC83117324DD500581C7C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "YouTube Video Player Demo/YouTube Video Player Demo-Prefix.pch"; - INFOPLIST_FILE = "YouTube Video Player Demo/YouTube Video Player Demo-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C29CC80417324DD400581C7C /* Build configuration list for PBXProject "YouTube Video Player Demo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C29CC82D17324DD500581C7C /* Debug */, - C29CC82E17324DD500581C7C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C29CC82F17324DD500581C7C /* Build configuration list for PBXNativeTarget "YouTube Video Player Demo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C29CC83017324DD500581C7C /* Debug */, - C29CC83117324DD500581C7C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = C29CC80117324DD400581C7C /* Project object */; -} diff --git a/YouTube Video Player Demo.xcworkspace/contents.xcworkspacedata b/YouTube Video Player Demo.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..f5f17e997 --- /dev/null +++ b/YouTube Video Player Demo.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/YouTube Video Player Demo/AppDelegate.m b/YouTube Video Player Demo/AppDelegate.m index f9362dd8b..7efb951dc 100644 --- a/YouTube Video Player Demo/AppDelegate.m +++ b/YouTube Video Player Demo/AppDelegate.m @@ -8,23 +8,20 @@ #import "AppDelegate.h" -#import "XCDYouTubeVideoPlayerViewController.h" -#import "DemoViewController.h" - @implementation AppDelegate @synthesize window = _window; - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoPlayerViewControllerDidReceiveMetadata:) name:XCDYouTubeVideoPlayerViewControllerDidReceiveMetadataNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerPlaybackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerPlaybackStateDidChange:) name:MPMoviePlayerPlaybackStateDidChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerLoadStateDidChange:) name:MPMoviePlayerLoadStateDidChangeNotification object:nil]; + [[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"VideoIdentifier": @"9bZkp7q19f0" }]; + + NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter]; + [defaultCenter addObserver:self selector:@selector(videoPlayerViewControllerDidReceiveMetadata:) name:XCDYouTubeVideoPlayerViewControllerDidReceiveMetadataNotification object:nil]; + [defaultCenter addObserver:self selector:@selector(moviePlayerPlaybackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; + [defaultCenter addObserver:self selector:@selector(moviePlayerPlaybackStateDidChange:) name:MPMoviePlayerPlaybackStateDidChangeNotification object:nil]; + [defaultCenter addObserver:self selector:@selector(moviePlayerLoadStateDidChange:) name:MPMoviePlayerLoadStateDidChangeNotification object:nil]; - self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[DemoViewController new]]; - [self.window makeKeyAndVisible]; return YES; } diff --git a/YouTube Video Player Demo/DemoAsynchronousViewController.h b/YouTube Video Player Demo/DemoAsynchronousViewController.h new file mode 100644 index 000000000..f1f5c6abc --- /dev/null +++ b/YouTube Video Player Demo/DemoAsynchronousViewController.h @@ -0,0 +1,13 @@ +// +// DemoAsynchronousViewController.h +// YouTube Video Player Demo +// +// Created by Cédric Luthi on 26.09.13. +// Copyright (c) 2013 Cédric Luthi. All rights reserved. +// + +@interface DemoAsynchronousViewController : UIViewController + +- (IBAction) play:(id)sender; + +@end diff --git a/YouTube Video Player Demo/DemoAsynchronousViewController.m b/YouTube Video Player Demo/DemoAsynchronousViewController.m new file mode 100644 index 000000000..560c6acb9 --- /dev/null +++ b/YouTube Video Player Demo/DemoAsynchronousViewController.m @@ -0,0 +1,27 @@ +// +// DemoAsynchronousViewController.m +// YouTube Video Player Demo +// +// Created by Cédric Luthi on 26.09.13. +// Copyright (c) 2013 Cédric Luthi. All rights reserved. +// + +#import "DemoAsynchronousViewController.h" + +@implementation DemoAsynchronousViewController + +- (IBAction) play:(id)sender +{ + XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [XCDYouTubeVideoPlayerViewController new]; + [self presentMoviePlayerViewControllerAnimated:videoPlayerViewController]; + + // https://developers.google.com/youtube/2.0/developers_guide_protocol_video_feeds#Standard_feeds + NSURL *url = [NSURL URLWithString:@"https://gdata.youtube.com/feeds/api/standardfeeds/most_popular?v=2&alt=json&time=today&max-results=1"]; + [NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:url] queue:[NSOperationQueue new] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { + id json = [NSJSONSerialization JSONObjectWithData:data ?: [NSData new] options:0 error:NULL]; + NSString *videoIdentifier = [[[json valueForKeyPath:@"feed.entry.media$group.yt$videoid.$t"] lastObject] description]; + videoPlayerViewController.videoIdentifier = videoIdentifier; + }]; +} + +@end diff --git a/YouTube Video Player Demo/DemoFullScreenViewController.h b/YouTube Video Player Demo/DemoFullScreenViewController.h new file mode 100644 index 000000000..2a5573dd4 --- /dev/null +++ b/YouTube Video Player Demo/DemoFullScreenViewController.h @@ -0,0 +1,16 @@ +// +// DemoFullScreenViewController.h +// YouTube Video Player Demo +// +// Created by Cédric Luthi on 26.09.13. +// Copyright (c) 2013 Cédric Luthi. All rights reserved. +// + +@interface DemoFullScreenViewController : UIViewController + +@property (nonatomic, weak) IBOutlet UITextField *videoIdentifierTextField; +@property (nonatomic, weak) IBOutlet UISwitch *lowQualitySwitch; + +- (IBAction) play:(id)sender; + +@end diff --git a/YouTube Video Player Demo/DemoFullScreenViewController.m b/YouTube Video Player Demo/DemoFullScreenViewController.m new file mode 100644 index 000000000..a608f897d --- /dev/null +++ b/YouTube Video Player Demo/DemoFullScreenViewController.m @@ -0,0 +1,47 @@ +// +// DemoFullScreenViewController.m +// YouTube Video Player Demo +// +// Created by Cédric Luthi on 26.09.13. +// Copyright (c) 2013 Cédric Luthi. All rights reserved. +// + +#import "DemoFullScreenViewController.h" + +@implementation DemoFullScreenViewController + +- (void) viewDidLoad +{ + [super viewDidLoad]; + + self.videoIdentifierTextField.text = [[NSUserDefaults standardUserDefaults] objectForKey:@"VideoIdentifier"]; +} + +- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + [self.view endEditing:YES]; +} + +- (IBAction) play:(id)sender +{ + [self.view endEditing:YES]; + + XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:self.videoIdentifierTextField.text]; + videoPlayerViewController.preferredVideoQualities = self.lowQualitySwitch.on ? @[ @(XCDYouTubeVideoQualitySmall240), @(XCDYouTubeVideoQualityMedium360) ] : nil; + [self presentMoviePlayerViewControllerAnimated:videoPlayerViewController]; +} + +#pragma mark - UITextFieldDelegate + +- (BOOL) textFieldShouldReturn:(UITextField *)textField +{ + [self play:textField]; + return YES; +} + +- (void) textFieldDidEndEditing:(UITextField *)textField +{ + [[NSUserDefaults standardUserDefaults] setObject:textField.text forKey:@"VideoIdentifier"]; +} + +@end diff --git a/YouTube Video Player Demo/DemoInlineViewController.h b/YouTube Video Player Demo/DemoInlineViewController.h new file mode 100644 index 000000000..653de933d --- /dev/null +++ b/YouTube Video Player Demo/DemoInlineViewController.h @@ -0,0 +1,18 @@ +// +// DemoInlineViewController.h +// YouTube Video Player Demo +// +// Created by Cédric Luthi on 26.09.13. +// Copyright (c) 2013 Cédric Luthi. All rights reserved. +// + +@interface DemoInlineViewController : UIViewController + +@property (nonatomic, weak) IBOutlet UIView *videoContainerView; +@property (nonatomic, weak) IBOutlet UISwitch *prepareToPlaySwitch; +@property (nonatomic, weak) IBOutlet UISwitch *shouldAutoplaySwitch; + +- (IBAction) load:(id)sender; +- (IBAction) prepareToPlay:(UISwitch *)sender; + +@end diff --git a/YouTube Video Player Demo/DemoInlineViewController.m b/YouTube Video Player Demo/DemoInlineViewController.m new file mode 100644 index 000000000..1671fb610 --- /dev/null +++ b/YouTube Video Player Demo/DemoInlineViewController.m @@ -0,0 +1,46 @@ +// +// DemoInlineViewController.m +// YouTube Video Player Demo +// +// Created by Cédric Luthi on 26.09.13. +// Copyright (c) 2013 Cédric Luthi. All rights reserved. +// + +#import "DemoInlineViewController.h" + +@interface DemoInlineViewController () + +@property (nonatomic, strong) XCDYouTubeVideoPlayerViewController *videoPlayerViewController; + +@end + +@implementation DemoInlineViewController + +- (void) viewWillDisappear:(BOOL)animated +{ + // Beware, viewWillDisappear: is called when the player view enters full screen on iOS 6+ + if ([self isMovingFromParentViewController]) + [self.videoPlayerViewController.moviePlayer stop]; +} + +- (IBAction) load:(id)sender +{ + [self.videoContainerView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; + + self.videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:@"VpZmIiIXuZ0"]; + + [self.videoPlayerViewController presentInView:self.videoContainerView]; + + if (self.prepareToPlaySwitch.on) + [self.videoPlayerViewController.moviePlayer prepareToPlay]; + + self.videoPlayerViewController.moviePlayer.shouldAutoplay = self.shouldAutoplaySwitch.on; +} + +- (IBAction) prepareToPlay:(UISwitch *)sender +{ + if (sender.on) + [self.videoPlayerViewController.moviePlayer prepareToPlay]; +} + +@end diff --git a/YouTube Video Player Demo/DemoThumbnailViewController.h b/YouTube Video Player Demo/DemoThumbnailViewController.h new file mode 100644 index 000000000..353c93810 --- /dev/null +++ b/YouTube Video Player Demo/DemoThumbnailViewController.h @@ -0,0 +1,18 @@ +// +// DemoThumbnailViewController.h +// YouTube Video Player Demo +// +// Created by Cédric Luthi on 26.09.13. +// Copyright (c) 2013 Cédric Luthi. All rights reserved. +// + +@interface DemoThumbnailViewController : UIViewController + +@property (nonatomic, weak) IBOutlet UIButton *actionButton; +@property (nonatomic, weak) IBOutlet UIView *videoContainerView; +@property (nonatomic, weak) IBOutlet UIImageView *thumbnailImageView; +@property (nonatomic, weak) IBOutlet UILabel *titleLabel; + +- (IBAction) loadThumbnail:(id)sender; + +@end diff --git a/YouTube Video Player Demo/DemoThumbnailViewController.m b/YouTube Video Player Demo/DemoThumbnailViewController.m new file mode 100644 index 000000000..b3b4cf484 --- /dev/null +++ b/YouTube Video Player Demo/DemoThumbnailViewController.m @@ -0,0 +1,60 @@ +// +// DemoThumbnailViewController.m +// YouTube Video Player Demo +// +// Created by Cédric Luthi on 26.09.13. +// Copyright (c) 2013 Cédric Luthi. All rights reserved. +// + +#import "DemoThumbnailViewController.h" + +@interface DemoThumbnailViewController () + +@property (nonatomic, strong) XCDYouTubeVideoPlayerViewController *videoPlayerViewController; + +@end + +@implementation DemoThumbnailViewController + +- (IBAction) loadThumbnail:(id)sender +{ + self.videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:@"VpZmIiIXuZ0"]; + + NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter]; + [defaultCenter addObserver:self selector:@selector(videoPlayerViewControllerDidReceiveMetadata:) name:XCDYouTubeVideoPlayerViewControllerDidReceiveMetadataNotification object:self.videoPlayerViewController]; + [defaultCenter addObserver:self selector:@selector(moviePlayerPlaybackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:self.videoPlayerViewController.moviePlayer]; +} + +- (IBAction) play:(id)sender +{ + [self.videoPlayerViewController presentInView:self.videoContainerView]; + [self.videoPlayerViewController.moviePlayer play]; +} + +#pragma mark - Notifications + +- (void) videoPlayerViewControllerDidReceiveMetadata:(NSNotification *)notification +{ + self.titleLabel.text = notification.userInfo[XCDMetadataKeyTitle]; + + NSURL *thumbnailURL = notification.userInfo[XCDMetadataKeyMediumThumbnailURL] ?: notification.userInfo[XCDMetadataKeySmallThumbnailURL]; + [NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:thumbnailURL] queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { + self.thumbnailImageView.image = [UIImage imageWithData:data]; + + [self.actionButton setTitle:NSLocalizedString(@"Play Video", nil) forState:UIControlStateNormal]; + [self.actionButton removeTarget:self action:NULL forControlEvents:UIControlEventAllEvents]; + [self.actionButton addTarget:self action:@selector(play:) forControlEvents:UIControlEventTouchUpInside]; + }]; +} + +- (void) moviePlayerPlaybackDidFinish:(NSNotification *)notification +{ + NSError *error = notification.userInfo[XCDMoviePlayerPlaybackDidFinishErrorUserInfoKey]; + if (error) + { + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil) message:error.localizedDescription delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil]; + [alertView show]; + } +} + +@end diff --git a/YouTube Video Player Demo/DemoViewController.h b/YouTube Video Player Demo/DemoViewController.h deleted file mode 100644 index 1cf58425e..000000000 --- a/YouTube Video Player Demo/DemoViewController.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// ViewController.h -// YouTube Video Player Demo -// -// Created by Cédric Luthi on 02.05.13. -// Copyright (c) 2013 Cédric Luthi. All rights reserved. -// - -@interface DemoViewController : UIViewController - -@end diff --git a/YouTube Video Player Demo/DemoViewController.m b/YouTube Video Player Demo/DemoViewController.m deleted file mode 100644 index 50b9f09ee..000000000 --- a/YouTube Video Player Demo/DemoViewController.m +++ /dev/null @@ -1,141 +0,0 @@ -// -// ViewController.m -// YouTube Video Player Demo -// -// Created by Cédric Luthi on 02.05.13. -// Copyright (c) 2013 Cédric Luthi. All rights reserved. -// - -#import "DemoViewController.h" - -#import "XCDYouTubeVideoPlayerViewController.h" - -@interface DemoViewController () -@property (nonatomic, weak) IBOutlet UITextField *videoIdentifierTextField; -@property (nonatomic, weak) IBOutlet UISwitch *lowQualitySwitch; -@property (nonatomic, weak) IBOutlet UIView *videoContainerView; -@property (nonatomic, weak) IBOutlet UISwitch *fullScreenSwitch; - -@property (nonatomic, strong) XCDYouTubeVideoPlayerViewController *videoPlayerViewController; -@end - -@implementation DemoViewController - -- (id) initWithNibName:(NSString *)nibName bundle:(NSBundle *)nibBundle -{ - if (!(self = [super initWithNibName:nibName bundle:nibBundle])) - return nil; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoPlayerViewControllerDidReceiveMetadata:) name:XCDYouTubeVideoPlayerViewControllerDidReceiveMetadataNotification object:nil]; - - return self; -} - -- (void) dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (NSString *) title -{ - return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; -} - -- (void) viewDidLoad -{ - self.videoIdentifierTextField.superview.layer.cornerRadius = 10.f; -} - -- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event -{ - [self.view endEditing:YES]; -} - -- (IBAction) playYouTubeVideo:(id)sender -{ - if (!self.videoPlayerViewController) - self.videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:self.videoIdentifierTextField.text]; - else - self.videoPlayerViewController.videoIdentifier = self.videoIdentifierTextField.text; - - if (self.lowQualitySwitch.on) - self.videoPlayerViewController.preferredVideoQualities = @[ @(XCDYouTubeVideoQualitySmall240), @(XCDYouTubeVideoQualityMedium360) ]; - - if (self.fullScreenSwitch.on) - [self presentMoviePlayerViewControllerAnimated:self.videoPlayerViewController]; - else - [self.videoPlayerViewController presentInView:self.videoContainerView]; -} - -- (IBAction) playTrendingVideo:(id)sender -{ - XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [XCDYouTubeVideoPlayerViewController new]; - if (self.fullScreenSwitch.on) - { - [self presentMoviePlayerViewControllerAnimated:videoPlayerViewController]; - } - else - { - [self.videoContainerView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; - [videoPlayerViewController presentInView:self.videoContainerView]; - [videoPlayerViewController.moviePlayer prepareToPlay]; - } - - // https://developers.google.com/youtube/2.0/developers_guide_protocol_video_feeds#Standard_feeds - NSURL *url = [NSURL URLWithString:@"https://gdata.youtube.com/feeds/api/standardfeeds/on_the_web?v=2&alt=json&max-results=1"]; - [NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:url] queue:[NSOperationQueue new] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { - id json = [NSJSONSerialization JSONObjectWithData:data ?: [NSData new] options:0 error:NULL]; - NSString *videoIdentifier = [[[json valueForKeyPath:@"feed.entry.media$group.yt$videoid.$t"] lastObject] description]; - videoPlayerViewController.videoIdentifier = videoIdentifier; - }]; -} - -- (BOOL) textFieldShouldReturn:(UITextField *)textField -{ - [self playYouTubeVideo:textField]; - return YES; -} - -#pragma mark - Notifications - -- (void) videoPlayerViewControllerDidReceiveMetadata:(NSNotification *)notification -{ - if (notification.object != self.videoPlayerViewController) - return; - - NSURL *thumbnailURL = notification.userInfo[XCDMetadataKeyMediumThumbnailURL] ?: notification.userInfo[XCDMetadataKeySmallThumbnailURL]; - [NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:thumbnailURL] queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { - UIImageView *thumbnailImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.videoContainerView.bounds.size.width, self.videoContainerView.bounds.size.height)]; - thumbnailImageView.image = [UIImage imageWithData:data]; - thumbnailImageView.backgroundColor = [UIColor blackColor]; - thumbnailImageView.contentMode = UIViewContentModeScaleAspectFit; - thumbnailImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - thumbnailImageView.userInteractionEnabled = YES; - [self.videoContainerView addSubview:thumbnailImageView]; - - // Do not get the `Play` image like this in production code - NSString *simulatorRoot = [[[NSProcessInfo processInfo] environment] objectForKey:@"IPHONE_SIMULATOR_ROOT"] ?: @""; - NSBundle *quickTimePlugin = [NSBundle bundleWithPath:[simulatorRoot stringByAppendingPathComponent:@"/System/Library/Internet Plug-Ins/QuickTime Plugin.webplugin"]]; - NSURL *playURL = [quickTimePlugin URLForResource:@"Play" withExtension:@"png"]; - UIImage *playImage = [UIImage imageWithContentsOfFile:playURL.path]; - UIButton *playButton = [UIButton buttonWithType:UIButtonTypeCustom]; - playButton.frame = thumbnailImageView.frame; - playButton.autoresizingMask = thumbnailImageView.autoresizingMask; - [playButton setImage:playImage forState:UIControlStateNormal]; - [playButton addTarget:self action:@selector(play:) forControlEvents:UIControlEventTouchUpInside]; - [thumbnailImageView addSubview:playButton]; - }]; -} - -- (void) play:(UIButton *)sender -{ - [UIView animateWithDuration:0.3f animations:^{ - sender.superview.alpha = 0.f; - } completion:^(BOOL finished) { - [sender.superview removeFromSuperview]; - }]; - - [self.videoPlayerViewController.moviePlayer play]; -} - -@end diff --git a/YouTube Video Player Demo/DemoViewController.xib b/YouTube Video Player Demo/DemoViewController.xib deleted file mode 100644 index 913501f58..000000000 --- a/YouTube Video Player Demo/DemoViewController.xib +++ /dev/null @@ -1,552 +0,0 @@ - - - - 1552 - 12D78 - 3084 - 1187.37 - 626.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 2083 - - - IBProxyObject - IBUIButton - IBUILabel - IBUISwitch - IBUITextField - IBUIView - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - - - 293 - - - - 269 - - - - 300 - {{10, 19}, {104, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Low Quality: - - 3 - MQA - - - 0 - 2 - - 1 - 17 - - - Helvetica - 17 - 16 - - NO - - - - 297 - {{118, 16}, {94, 27}} - - - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - - - {{36, 63}, {230, 60}} - - - - _NS:10 - - 3 - MCAwAA - - IBCocoaTouchFramework - - - - 293 - {{20, 20}, {100, 44}} - - - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - 1 - Play Video - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 3 - MC41AA - - - 2 - 15 - - - Helvetica-Bold - 15 - 16 - - - - - 293 - {{128, 27}, {152, 30}} - - - - _NS:9 - NO - YES - IBCocoaTouchFramework - 0 - 9bZkp7q19f0 - 3 - - 3 - MAA - - 2 - - - 1 - YES - 17 - - IBCocoaTouchFramework - - 1 - - - - - {{10, 10}, {300, 131}} - - - - _NS:10 - - 3 - MC4zMzMzMzMzMzMzAA - - IBCocoaTouchFramework - - - - 293 - {{76, 149}, {169, 44}} - - - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - 1 - Play Trending Video - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - - - - - 282 - - {{20, 200}, {280, 174}} - - - - _NS:9 - - 3 - MC42NjY2NjY2NjY3AA - - IBCocoaTouchFramework - - - - 269 - - - - 300 - {{10, 11}, {104, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Full Screen: - - 0 - 2 - - - NO - - - - 297 - {{118, 8}, {94, 27}} - - - _NS:9 - NO - IBCocoaTouchFramework - 0 - 0 - YES - - - {{45, 373}, {230, 43}} - - - - _NS:10 - - IBCocoaTouchFramework - - - {{0, 64}, {320, 416}} - - - - - 3 - MC43NQA - - - NO - - - NO - - - IBUIScreenMetrics - - YES - - - - - - {320, 480} - {480, 320} - - - IBCocoaTouchFramework - Retina 3.5 Full Screen - 0 - - IBCocoaTouchFramework - - - - - - - view - - - - 7 - - - - lowQualitySwitch - - - - 20 - - - - videoIdentifierTextField - - - - 17 - - - - videoContainerView - - - - 32 - - - - fullScreenSwitch - - - - 38 - - - - playYouTubeVideo: - - - 7 - - 16 - - - - delegate - - - - 24 - - - - playTrendingVideo: - - - 7 - - 30 - - - - - - 0 - - - - - - -1 - - - File's Owner - - - -2 - - - - - 6 - - - - - - - - - - - 27 - - - - - 29 - - - - - - - - - - 21 - - - - - - - - - 18 - - - - - 19 - - - - - 14 - - - - - 15 - - - - - 31 - - - - - - 35 - - - - - - - - - 37 - - - - - 36 - - - - - - - DemoViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 38 - - - - - DemoViewController - UIViewController - - id - id - - - - playTrendingVideo: - id - - - playYouTubeVideo: - id - - - - UISwitch - UISwitch - UIView - UITextField - - - - fullScreenSwitch - UISwitch - - - lowQualitySwitch - UISwitch - - - videoContainerView - UIView - - - videoIdentifierTextField - UITextField - - - - IBProjectSource - ./Classes/DemoViewController.h - - - - - 0 - IBCocoaTouchFramework - YES - 3 - 2083 - - diff --git a/YouTube Video Player Demo/Default-568h@2x.png b/YouTube Video Player Demo/Supporting Files/Default-568h@2x.png similarity index 100% rename from YouTube Video Player Demo/Default-568h@2x.png rename to YouTube Video Player Demo/Supporting Files/Default-568h@2x.png diff --git a/YouTube Video Player Demo/Default.png b/YouTube Video Player Demo/Supporting Files/Default.png similarity index 100% rename from YouTube Video Player Demo/Default.png rename to YouTube Video Player Demo/Supporting Files/Default.png diff --git a/YouTube Video Player Demo/Default@2x.png b/YouTube Video Player Demo/Supporting Files/Default@2x.png similarity index 100% rename from YouTube Video Player Demo/Default@2x.png rename to YouTube Video Player Demo/Supporting Files/Default@2x.png diff --git a/YouTube Video Player Demo/Supporting Files/Icon@2x.png b/YouTube Video Player Demo/Supporting Files/Icon@2x.png new file mode 100644 index 000000000..ddbb28eee Binary files /dev/null and b/YouTube Video Player Demo/Supporting Files/Icon@2x.png differ diff --git a/YouTube Video Player Demo/YouTube Video Player Demo-Info.plist b/YouTube Video Player Demo/Supporting Files/YouTube Video Player Demo-Info.plist similarity index 90% rename from YouTube Video Player Demo/YouTube Video Player Demo-Info.plist rename to YouTube Video Player Demo/Supporting Files/YouTube Video Player Demo-Info.plist index c60cca643..5abf8ea07 100644 --- a/YouTube Video Player Demo/YouTube Video Player Demo-Info.plist +++ b/YouTube Video Player Demo/Supporting Files/YouTube Video Player Demo-Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion en CFBundleDisplayName - ${PRODUCT_NAME} + YouTube ▶ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier @@ -17,11 +17,13 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.1.0 + 1.1.1 CFBundleVersion - ${CURRENT_PROJECT_VERSION} + 0 LSRequiresIPhoneOS + UIMainStoryboardFile + MainStoryboard UIRequiredDeviceCapabilities armv7 diff --git a/YouTube Video Player Demo/YouTube Video Player Demo-Prefix.pch b/YouTube Video Player Demo/Supporting Files/YouTube Video Player Demo-Prefix.pch similarity index 60% rename from YouTube Video Player Demo/YouTube Video Player Demo-Prefix.pch rename to YouTube Video Player Demo/Supporting Files/YouTube Video Player Demo-Prefix.pch index 7148aca03..aea735961 100644 --- a/YouTube Video Player Demo/YouTube Video Player Demo-Prefix.pch +++ b/YouTube Video Player Demo/Supporting Files/YouTube Video Player Demo-Prefix.pch @@ -4,12 +4,12 @@ #import -#ifndef __IPHONE_4_0 -#warning "This project uses features only available in iOS SDK 4.0 and later." +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ #import #import - #import + #import #endif diff --git a/YouTube Video Player Demo/main.m b/YouTube Video Player Demo/Supporting Files/main.m similarity index 100% rename from YouTube Video Player Demo/main.m rename to YouTube Video Player Demo/Supporting Files/main.m diff --git a/YouTube Video Player Demo/YouTube Video Player Demo.xcodeproj/project.pbxproj b/YouTube Video Player Demo/YouTube Video Player Demo.xcodeproj/project.pbxproj new file mode 100644 index 000000000..b7f57c1cd --- /dev/null +++ b/YouTube Video Player Demo/YouTube Video Player Demo.xcodeproj/project.pbxproj @@ -0,0 +1,332 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + C2478E9D17FF739100BCE94D /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C2478E9C17FF739100BCE94D /* Icon@2x.png */; }; + C27415A217F491230026834B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C27415A117F491230026834B /* UIKit.framework */; }; + C27415A417F491230026834B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C27415A317F491230026834B /* Foundation.framework */; }; + C27415A617F491230026834B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C27415A517F491230026834B /* CoreGraphics.framework */; }; + C27415D217F4CDD80026834B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C27415C017F4CDD80026834B /* AppDelegate.m */; }; + C27415D317F4CDD80026834B /* DemoAsynchronousViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C27415C217F4CDD80026834B /* DemoAsynchronousViewController.m */; }; + C27415D417F4CDD80026834B /* DemoFullScreenViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C27415C417F4CDD80026834B /* DemoFullScreenViewController.m */; }; + C27415D517F4CDD80026834B /* DemoInlineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C27415C617F4CDD80026834B /* DemoInlineViewController.m */; }; + C27415D617F4CDD80026834B /* DemoThumbnailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C27415C817F4CDD80026834B /* DemoThumbnailViewController.m */; }; + C27415D717F4CDD80026834B /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C27415C917F4CDD80026834B /* MainStoryboard.storyboard */; }; + C27415D817F4CDD80026834B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C27415CC17F4CDD80026834B /* Default-568h@2x.png */; }; + C27415D917F4CDD80026834B /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = C27415CD17F4CDD80026834B /* Default.png */; }; + C27415DA17F4CDD80026834B /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C27415CE17F4CDD80026834B /* Default@2x.png */; }; + C27415DC17F4CDD80026834B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C27415D117F4CDD80026834B /* main.m */; }; + C27415E317F4D02E0026834B /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C27415E217F4D02E0026834B /* AVFoundation.framework */; }; + C27415E517F4D0330026834B /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C27415E417F4D0330026834B /* MediaPlayer.framework */; }; + C2EDD2ED1805917900BEA32B /* libXCDYouTubeVideoPlayerViewController.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C2EDD2EC1805917900BEA32B /* libXCDYouTubeVideoPlayerViewController.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + C2478E9C17FF739100BCE94D /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = ""; }; + C274159E17F491230026834B /* YouTube Video Player Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "YouTube Video Player Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + C27415A117F491230026834B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + C27415A317F491230026834B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + C27415A517F491230026834B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + C27415BF17F4CDD80026834B /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + C27415C017F4CDD80026834B /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + C27415C117F4CDD80026834B /* DemoAsynchronousViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoAsynchronousViewController.h; sourceTree = ""; }; + C27415C217F4CDD80026834B /* DemoAsynchronousViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoAsynchronousViewController.m; sourceTree = ""; }; + C27415C317F4CDD80026834B /* DemoFullScreenViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoFullScreenViewController.h; sourceTree = ""; }; + C27415C417F4CDD80026834B /* DemoFullScreenViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoFullScreenViewController.m; sourceTree = ""; }; + C27415C517F4CDD80026834B /* DemoInlineViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoInlineViewController.h; sourceTree = ""; }; + C27415C617F4CDD80026834B /* DemoInlineViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoInlineViewController.m; sourceTree = ""; }; + C27415C717F4CDD80026834B /* DemoThumbnailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoThumbnailViewController.h; sourceTree = ""; }; + C27415C817F4CDD80026834B /* DemoThumbnailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoThumbnailViewController.m; sourceTree = ""; }; + C27415CA17F4CDD80026834B /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = ""; }; + C27415CC17F4CDD80026834B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + C27415CD17F4CDD80026834B /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; + C27415CE17F4CDD80026834B /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; + C27415D117F4CDD80026834B /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + C27415DD17F4CE4A0026834B /* YouTube Video Player Demo-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "YouTube Video Player Demo-Info.plist"; sourceTree = ""; }; + C27415DE17F4CE4A0026834B /* YouTube Video Player Demo-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "YouTube Video Player Demo-Prefix.pch"; sourceTree = ""; }; + C27415E217F4D02E0026834B /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = /Applications/Xcode4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = ""; }; + C27415E417F4D0330026834B /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = /Applications/Xcode4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = ""; }; + C2EDD2EC1805917900BEA32B /* libXCDYouTubeVideoPlayerViewController.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libXCDYouTubeVideoPlayerViewController.a; path = "../build/Debug-iphoneos/libXCDYouTubeVideoPlayerViewController.a"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + C274159B17F491230026834B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C2EDD2ED1805917900BEA32B /* libXCDYouTubeVideoPlayerViewController.a in Frameworks */, + C27415E317F4D02E0026834B /* AVFoundation.framework in Frameworks */, + C27415A617F491230026834B /* CoreGraphics.framework in Frameworks */, + C27415A417F491230026834B /* Foundation.framework in Frameworks */, + C27415E517F4D0330026834B /* MediaPlayer.framework in Frameworks */, + C27415A217F491230026834B /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + C274159517F491230026834B = { + isa = PBXGroup; + children = ( + C27415BE17F4CDD80026834B /* YouTube Video Player Demo */, + C27415A017F491230026834B /* Frameworks */, + C274159F17F491230026834B /* Products */, + ); + sourceTree = ""; + }; + C274159F17F491230026834B /* Products */ = { + isa = PBXGroup; + children = ( + C274159E17F491230026834B /* YouTube Video Player Demo.app */, + ); + name = Products; + sourceTree = ""; + }; + C27415A017F491230026834B /* Frameworks */ = { + isa = PBXGroup; + children = ( + C2EDD2EC1805917900BEA32B /* libXCDYouTubeVideoPlayerViewController.a */, + C27415E217F4D02E0026834B /* AVFoundation.framework */, + C27415A517F491230026834B /* CoreGraphics.framework */, + C27415A317F491230026834B /* Foundation.framework */, + C27415E417F4D0330026834B /* MediaPlayer.framework */, + C27415A117F491230026834B /* UIKit.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + C27415BE17F4CDD80026834B /* YouTube Video Player Demo */ = { + isa = PBXGroup; + children = ( + C27415BF17F4CDD80026834B /* AppDelegate.h */, + C27415C017F4CDD80026834B /* AppDelegate.m */, + C27415C317F4CDD80026834B /* DemoFullScreenViewController.h */, + C27415C417F4CDD80026834B /* DemoFullScreenViewController.m */, + C27415C517F4CDD80026834B /* DemoInlineViewController.h */, + C27415C617F4CDD80026834B /* DemoInlineViewController.m */, + C27415C717F4CDD80026834B /* DemoThumbnailViewController.h */, + C27415C817F4CDD80026834B /* DemoThumbnailViewController.m */, + C27415C117F4CDD80026834B /* DemoAsynchronousViewController.h */, + C27415C217F4CDD80026834B /* DemoAsynchronousViewController.m */, + C27415C917F4CDD80026834B /* MainStoryboard.storyboard */, + C27415CB17F4CDD80026834B /* Supporting Files */, + ); + name = "YouTube Video Player Demo"; + sourceTree = ""; + }; + C27415CB17F4CDD80026834B /* Supporting Files */ = { + isa = PBXGroup; + children = ( + C27415CD17F4CDD80026834B /* Default.png */, + C27415CE17F4CDD80026834B /* Default@2x.png */, + C27415CC17F4CDD80026834B /* Default-568h@2x.png */, + C2478E9C17FF739100BCE94D /* Icon@2x.png */, + C27415D117F4CDD80026834B /* main.m */, + C27415DD17F4CE4A0026834B /* YouTube Video Player Demo-Info.plist */, + C27415DE17F4CE4A0026834B /* YouTube Video Player Demo-Prefix.pch */, + ); + path = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C274159D17F491230026834B /* YouTube Video Player Demo */ = { + isa = PBXNativeTarget; + buildConfigurationList = C27415BB17F491230026834B /* Build configuration list for PBXNativeTarget "YouTube Video Player Demo" */; + buildPhases = ( + C274159A17F491230026834B /* Sources */, + C274159B17F491230026834B /* Frameworks */, + C274159C17F491230026834B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "YouTube Video Player Demo"; + productName = "YouTube Video Player Demo"; + productReference = C274159E17F491230026834B /* YouTube Video Player Demo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C274159617F491230026834B /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0460; + ORGANIZATIONNAME = "Cédric Luthi"; + }; + buildConfigurationList = C274159917F491230026834B /* Build configuration list for PBXProject "YouTube Video Player Demo" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = C274159517F491230026834B; + productRefGroup = C274159F17F491230026834B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C274159D17F491230026834B /* YouTube Video Player Demo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + C274159C17F491230026834B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C27415D717F4CDD80026834B /* MainStoryboard.storyboard in Resources */, + C27415D917F4CDD80026834B /* Default.png in Resources */, + C27415DA17F4CDD80026834B /* Default@2x.png in Resources */, + C27415D817F4CDD80026834B /* Default-568h@2x.png in Resources */, + C2478E9D17FF739100BCE94D /* Icon@2x.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + C274159A17F491230026834B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C27415D217F4CDD80026834B /* AppDelegate.m in Sources */, + C27415D317F4CDD80026834B /* DemoAsynchronousViewController.m in Sources */, + C27415D417F4CDD80026834B /* DemoFullScreenViewController.m in Sources */, + C27415D517F4CDD80026834B /* DemoInlineViewController.m in Sources */, + C27415D617F4CDD80026834B /* DemoThumbnailViewController.m in Sources */, + C27415DC17F4CDD80026834B /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + C27415C917F4CDD80026834B /* MainStoryboard.storyboard */ = { + isa = PBXVariantGroup; + children = ( + C27415CA17F4CDD80026834B /* en */, + ); + name = MainStoryboard.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C27415B917F491230026834B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C27415BA17F491230026834B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C27415BC17F491230026834B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Supporting Files/YouTube Video Player Demo-Prefix.pch"; + HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/include"; + INFOPLIST_FILE = "Supporting Files/YouTube Video Player Demo-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + C27415BD17F491230026834B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Supporting Files/YouTube Video Player Demo-Prefix.pch"; + HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/include"; + INFOPLIST_FILE = "Supporting Files/YouTube Video Player Demo-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C274159917F491230026834B /* Build configuration list for PBXProject "YouTube Video Player Demo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C27415B917F491230026834B /* Debug */, + C27415BA17F491230026834B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C27415BB17F491230026834B /* Build configuration list for PBXNativeTarget "YouTube Video Player Demo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C27415BC17F491230026834B /* Debug */, + C27415BD17F491230026834B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = C274159617F491230026834B /* Project object */; +} diff --git a/YouTube Video Player Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/YouTube Video Player Demo/YouTube Video Player Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from YouTube Video Player Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to YouTube Video Player Demo/YouTube Video Player Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/YouTube Video Player Demo/en.lproj/MainStoryboard.storyboard b/YouTube Video Player Demo/en.lproj/MainStoryboard.storyboard new file mode 100644 index 000000000..589d07a68 --- /dev/null +++ b/YouTube Video Player Demo/en.lproj/MainStoryboard.storyboard @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file