Skip to content

Commit

Permalink
Merge branch 'release/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
0xced committed Oct 12, 2013
2 parents ae02d34 + 843d0c7 commit c53666a
Show file tree
Hide file tree
Showing 32 changed files with 1,299 additions and 1,060 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Binary file modified Screenshots/XCDYouTubeVideoPlayerViewController.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions XCDYouTubeVideoPlayerViewController.podspec
Original file line number Diff line number Diff line change
@@ -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" => "[email protected]" }
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'
Expand Down
269 changes: 269 additions & 0 deletions XCDYouTubeVideoPlayerViewController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -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 = "<group>"; };
C2A3F2D717F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCDYouTubeVideoPlayerViewController.m; sourceTree = "<group>"; };
/* 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 = "<group>";
};
C2A3F2CE17F4827800AC1C3B /* Products */ = {
isa = PBXGroup;
children = (
C2A3F2CD17F4827800AC1C3B /* libXCDYouTubeVideoPlayerViewController.a */,
);
name = Products;
sourceTree = "<group>";
};
C2A3F2CF17F4827800AC1C3B /* Frameworks */ = {
isa = PBXGroup;
children = (
C274158717F48AD10026834B /* AVFoundation.framework */,
C274158817F48AD10026834B /* MediaPlayer.framework */,
C274158917F48AD10026834B /* UIKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
C2A3F2D217F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController */ = {
isa = PBXGroup;
children = (
C2A3F2D517F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.h */,
C2A3F2D717F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.m */,
);
path = XCDYouTubeVideoPlayerViewController;
sourceTree = "<group>";
};
/* 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 */;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand All @@ -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.
Expand Down
Loading

0 comments on commit c53666a

Please sign in to comment.