Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a070f2c785 | |||
| 0935b0ec55 | |||
| 747f6bb56f | |||
| aea0881949 | |||
| df0e6caaaf | |||
| 3197515537 | |||
| 36cecee5bc | |||
| 3da484c5e2 | |||
| 59b9f3a5fe | |||
| 1e78889bf9 | |||
| 6d227fb37f | |||
| 3dd7e8a2be | |||
| 215670a00d | |||
| 4ef059b790 | |||
| 1f17c3e179 | |||
| cb0da4d8e0 | |||
| 85ecae532b | |||
| 45117c9c7e | |||
| 4e10d0cece |
@@ -328,6 +328,7 @@
|
||||
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)";
|
||||
@@ -344,6 +345,7 @@
|
||||
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)";
|
||||
|
||||
+99
@@ -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>
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
@class VIMVideoPlayer;
|
||||
|
||||
static const float TimeUpdateInterval = 0.1f;
|
||||
|
||||
@protocol VIMVideoPlayerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
@@ -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"}];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user