20 Commits

Author SHA1 Message Date
Gavin King 48f3222d28 Upgrading to Swift 2.3 2016-09-27 16:07:20 -04:00
Nicole Lehrer a070f2c785 Merge pull request #64 from vimeo/VIM-4496-airplayBug
VIM-4496: No Playback if Already in Airplay Mode
2016-09-01 22:37:26 -04:00
Nicole Lehrer 0935b0ec55 using default init 2016-08-30 13:55:38 -04:00
Gavin King 747f6bb56f Merge pull request #62 from vimeo/VIM-4419-drm-player-error-ui
VIM-4419: DRM player error UI
2016-08-22 16:38:15 -04:00
Gavin King aea0881949 better error handling 2016-08-16 15:40:55 -04:00
Gavin King df0e6caaaf Merge pull request #60 from vimeo/VIM-4503-session-time
VIM-4503: Session time
2016-08-12 16:00:23 -04:00
Gavin King 3197515537 moving constant 2016-08-11 11:01:53 -04:00
Gavin King 36cecee5bc Merge pull request #59 from vimeo/VIM-3520-airplay-mirror-bug
VIM-3520: Airplay Mirror Bug
2016-08-10 14:19:45 -04:00
Gavin King 3da484c5e2 airplay fix 2016-08-08 11:37:01 -04:00
Gavin King 59b9f3a5fe Merge pull request #53 from vimeo/v6.0.2
Merging v6.0.2 into master
2016-05-03 11:28:30 -04:00
Nicole Lehrer 1e78889bf9 Merge pull request #52 from vimeo/offlinePlaybackCrash
VIM-3864: Offline playback crash
2016-04-20 19:13:38 -04:00
Alfie Hanssen 6d227fb37f Merge pull request #49 from jersonperpetua/workspace_carthage_support
Workspace Carthage support
2016-04-20 15:36:06 -04:00
Nicole Lehrer 3dd7e8a2be revert back to 1f17c3e179 2016-04-16 15:32:03 -04:00
Nicole Lehrer 215670a00d make restart public 2016-04-16 12:35:05 -04:00
Nicole Lehrer 4ef059b790 remove check for isPlaying 2016-04-16 12:30:54 -04:00
Nicole Lehrer 1f17c3e179 check finished flag for success 2016-04-16 12:28:21 -04:00
Jerson Michael Perpetua cb0da4d8e0 Set the minimum target to iOS 8.0 2016-04-06 09:49:14 +08:00
Jerson Michael Perpetua 85ecae532b Add Carthage support by sharing the VimeoPlayer framework target 2016-04-06 09:49:05 +08:00
Alfie Hanssen 45117c9c7e Merge pull request #47 from vimeo/v6.0.2
v6.0.2 > Master
2016-04-01 12:31:14 -04:00
Gavin King 4e10d0cece Merge pull request #41 from vimeo/v6.0.1
Merging v6.0.1 into master
2016-03-15 19:26:09 -04:00
5 changed files with 162 additions and 9 deletions
@@ -210,13 +210,19 @@
TargetAttributes = {
AF87202C1CA44FBD004C752C = {
CreatedOnToolsVersion = 7.2;
DevelopmentTeam = 35R365FS4Q;
LastSwiftMigration = 0800;
};
AF8720401CA44FBD004C752C = {
CreatedOnToolsVersion = 7.2;
DevelopmentTeam = 35R365FS4Q;
LastSwiftMigration = 0800;
TestTargetID = AF87202C1CA44FBD004C752C;
};
AF87204B1CA44FBD004C752C = {
CreatedOnToolsVersion = 7.2;
DevelopmentTeam = 35R365FS4Q;
LastSwiftMigration = 0800;
TestTargetID = AF87202C1CA44FBD004C752C;
};
};
@@ -350,6 +356,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 35R365FS4Q;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -394,6 +401,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 35R365FS4Q;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -415,11 +423,13 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 35R365FS4Q;
INFOPLIST_FILE = "VimeoPlayer-iOS-Example/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.vimeo.VimeoPlayer-iOS-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "${SRCROOT}/VimeoPlayer-iOS-Example/Bridge.h";
SWIFT_VERSION = 2.3;
};
name = Debug;
};
@@ -427,11 +437,13 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 35R365FS4Q;
INFOPLIST_FILE = "VimeoPlayer-iOS-Example/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.vimeo.VimeoPlayer-iOS-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "${SRCROOT}/VimeoPlayer-iOS-Example/Bridge.h";
SWIFT_VERSION = 2.3;
};
name = Release;
};
@@ -439,10 +451,12 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = 35R365FS4Q;
INFOPLIST_FILE = "VimeoPlayer-iOS-ExampleTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.vimeo.VimeoPlayer-iOS-ExampleTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VimeoPlayer-iOS-Example.app/VimeoPlayer-iOS-Example";
};
name = Debug;
@@ -451,10 +465,12 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = 35R365FS4Q;
INFOPLIST_FILE = "VimeoPlayer-iOS-ExampleTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.vimeo.VimeoPlayer-iOS-ExampleTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VimeoPlayer-iOS-Example.app/VimeoPlayer-iOS-Example";
};
name = Release;
@@ -466,6 +482,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.vimeo.VimeoPlayer-iOS-ExampleUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
TEST_TARGET_NAME = "VimeoPlayer-iOS-Example";
USES_XCTRUNNER = YES;
};
@@ -478,6 +495,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.vimeo.VimeoPlayer-iOS-ExampleUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
TEST_TARGET_NAME = "VimeoPlayer-iOS-Example";
USES_XCTRUNNER = YES;
};
@@ -502,6 +520,7 @@
AF8720571CA44FBD004C752C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
AF8720581CA44FBD004C752C /* Build configuration list for PBXNativeTarget "VimeoPlayer-iOS-ExampleTests" */ = {
isa = XCConfigurationList;
@@ -510,6 +529,7 @@
AF87205A1CA44FBD004C752C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
AF87205B1CA44FBD004C752C /* Build configuration list for PBXNativeTarget "VimeoPlayer-iOS-ExampleUITests" */ = {
isa = XCConfigurationList;
@@ -518,6 +538,7 @@
AF87205D1CA44FBD004C752C /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
@@ -161,9 +161,11 @@
TargetAttributes = {
AF871FFD1CA447E5004C752C = {
CreatedOnToolsVersion = 7.2;
DevelopmentTeam = 35R365FS4Q;
};
AF8720071CA447E5004C752C = {
CreatedOnToolsVersion = 7.2;
DevelopmentTeam = 35R365FS4Q;
};
};
};
@@ -322,12 +324,15 @@
AF8720131CA447E5004C752C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 35R365FS4Q;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = VimeoPlayer/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.vimeo.VimeoPlayer;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -339,11 +344,13 @@
isa = XCBuildConfiguration;
buildSettings = {
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 35R365FS4Q;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = VimeoPlayer/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.vimeo.VimeoPlayer;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -354,6 +361,7 @@
AF8720161CA447E5004C752C /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = 35R365FS4Q;
INFOPLIST_FILE = VimeoPlayerTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.vimeo.VimeoPlayerTests;
@@ -364,6 +372,7 @@
AF8720171CA447E5004C752C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = 35R365FS4Q;
INFOPLIST_FILE = VimeoPlayerTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.vimeo.VimeoPlayerTests;
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AF871FFD1CA447E5004C752C"
BuildableName = "VimeoPlayer.framework"
BlueprintName = "VimeoPlayer"
ReferencedContainer = "container:VimeoPlayer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AF8720071CA447E5004C752C"
BuildableName = "VimeoPlayerTests.xctest"
BlueprintName = "VimeoPlayerTests"
ReferencedContainer = "container:VimeoPlayer.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AF871FFD1CA447E5004C752C"
BuildableName = "VimeoPlayer.framework"
BlueprintName = "VimeoPlayer"
ReferencedContainer = "container:VimeoPlayer.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AF871FFD1CA447E5004C752C"
BuildableName = "VimeoPlayer.framework"
BlueprintName = "VimeoPlayer"
ReferencedContainer = "container:VimeoPlayer.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AF871FFD1CA447E5004C752C"
BuildableName = "VimeoPlayer.framework"
BlueprintName = "VimeoPlayer"
ReferencedContainer = "container:VimeoPlayer.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
+2
View File
@@ -29,6 +29,8 @@
@class VIMVideoPlayer;
static const float TimeUpdateInterval = 0.1f;
@protocol VIMVideoPlayerDelegate <NSObject>
@optional
+31 -9
View File
@@ -28,7 +28,6 @@
static const float DefaultPlayableBufferLength = 2.0f;
static const float DefaultVolumeFadeDuration = 1.0f;
static const float TimeObserverInterval = 0.01f;
NSString * const kVideoPlayerErrorDomain = @"kVideoPlayerErrorDomain";
@@ -99,6 +98,8 @@ static void *VideoPlayer_PlayerItemLoadedTimeRangesContext = &VideoPlayer_Player
self.muted = NO;
self.looping = NO;
self.player.usesExternalPlaybackWhileExternalScreenIsActive = YES;
[self setVolume:1.0f];
[self enableTimeUpdates];
[self enableAirplay];
@@ -164,7 +165,8 @@ static void *VideoPlayer_PlayerItemLoadedTimeRangesContext = &VideoPlayer_Player
[self resetPlayerItemIfNecessary];
AVPlayerItem *playerItem = [[AVPlayerItem alloc] initWithAsset:asset automaticallyLoadedAssetKeys:@[NSStringFromSelector(@selector(tracks))]];
AVPlayerItem *playerItem = [[AVPlayerItem alloc] initWithAsset: asset];
if (!playerItem)
{
[self reportUnableToCreatePlayerItem];
@@ -444,13 +446,16 @@ static void *VideoPlayer_PlayerItemLoadedTimeRangesContext = &VideoPlayer_Player
{
[self.player seekToTime:kCMTimeZero toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero completionHandler:^(BOOL finished) {
_isAtEndTime = NO;
if (self.isPlaying)
if (finished)
{
[self play];
_isAtEndTime = NO;
if (self.isPlaying)
{
[self play];
}
}
}];
}
@@ -639,7 +644,7 @@ static void *VideoPlayer_PlayerItemLoadedTimeRangesContext = &VideoPlayer_Player
}
__weak typeof (self) weakSelf = self;
self.timeObserverToken = [self.player addPeriodicTimeObserverForInterval:CMTimeMakeWithSeconds(TimeObserverInterval, NSEC_PER_SEC) queue:dispatch_get_main_queue() usingBlock:^(CMTime time) {
self.timeObserverToken = [self.player addPeriodicTimeObserverForInterval:CMTimeMakeWithSeconds(TimeUpdateInterval, NSEC_PER_SEC) queue:dispatch_get_main_queue() usingBlock:^(CMTime time) {
__strong typeof (self) strongSelf = weakSelf;
if (!strongSelf)
@@ -716,12 +721,29 @@ static void *VideoPlayer_PlayerItemLoadedTimeRangesContext = &VideoPlayer_Player
NSLog(@"Video player Status Failed: player item error = %@", self.player.currentItem.error);
NSLog(@"Video player Status Failed: player error = %@", self.player.error);
// First, try to use the player error if it exists
NSError *error = self.player.error;
// Otherwise try to use the current item's error
if (!error)
{
error = self.player.currentItem.error;
}
else
// If there's a more specific underlyng error, use that
NSError *underlyingError = [error.userInfo objectForKey:NSUnderlyingErrorKey];
if (underlyingError)
{
error = underlyingError;
}
// Finally, construct our own as a last resort
if (!error)
{
error = [NSError errorWithDomain:kVideoPlayerErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey : @"unknown player error, status == AVPlayerItemStatusFailed"}];
}