diff --git a/.gitignore b/.gitignore index 05096f66..884d159c 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,7 @@ xcuserdata # Carthage/Checkouts Carthage/Build + +Pods/ +Podfile.lock +.DS_Store diff --git a/KALTURAPlayerSDK.xcodeproj/project.pbxproj b/KALTURAPlayerSDK.xcodeproj/project.pbxproj index e8172aa0..18e2df97 100644 --- a/KALTURAPlayerSDK.xcodeproj/project.pbxproj +++ b/KALTURAPlayerSDK.xcodeproj/project.pbxproj @@ -114,6 +114,7 @@ BFBE8EC01C0B174400649BDF /* KPControlsView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BFBE8E601C0B139400649BDF /* KPControlsView.h */; }; BFBE8EC11C0B174400649BDF /* KPControlsUIWebView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BFBE8E5E1C0B139400649BDF /* KPControlsUIWebView.h */; }; BFBE8EC21C0B174400649BDF /* KPControlsWKWebView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BFBE8E621C0B139400649BDF /* KPControlsWKWebView.h */; }; + EFE2C56E0569F6ABA07EFFBD /* libPods-KALTURAPlayerSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CFB27D189704B3679840E50C /* libPods-KALTURAPlayerSDK.a */; }; FB0B5AAE1C7FB3BE0067872E /* KPWidevineClassicHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = FB0B5AAD1C7FB3BE0067872E /* KPWidevineClassicHandler.m */; }; FB48BCB41C7B53E300B2E1B7 /* KPFairPlayHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = FB48BCB31C7B53E300B2E1B7 /* KPFairPlayHandler.m */; }; FB48BCB71C7C8A4800B2E1B7 /* KPAssetBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = FB48BCB61C7C8A4800B2E1B7 /* KPAssetBuilder.m */; }; @@ -199,9 +200,12 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0B763B2703DBDB4330D555CB /* Pods-KALTURAPlayerSDK.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-KALTURAPlayerSDK.debug.xcconfig"; path = "Pods/Target Support Files/Pods-KALTURAPlayerSDK/Pods-KALTURAPlayerSDK.debug.xcconfig"; sourceTree = ""; }; + 0B94380941711CC7A6654CD9 /* Pods-KALTURAPlayerSDK.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-KALTURAPlayerSDK.release.xcconfig"; path = "Pods/Target Support Files/Pods-KALTURAPlayerSDK/Pods-KALTURAPlayerSDK.release.xcconfig"; sourceTree = ""; }; 5F6879D41C271304003E5DF7 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 5F9A80181C1CCC0800DD930E /* NSDictionary+Utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Utilities.h"; sourceTree = ""; }; 5F9A80191C1CCC0800DD930E /* NSDictionary+Utilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+Utilities.m"; sourceTree = ""; }; + 9E2156ADFA169243A768B874 /* libPods-KALTURAPlayerSDKResources.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-KALTURAPlayerSDKResources.a"; sourceTree = BUILT_PRODUCTS_DIR; }; B372892E1A8787D00076DD33 /* KALTURAPlayerSDKResources.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KALTURAPlayerSDKResources.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; B37289311A8787D00076DD33 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BF0394EF1CA975C90090BF66 /* Utilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Utilities.m; sourceTree = ""; }; @@ -283,6 +287,7 @@ BFBE8E841C0B139400649BDF /* Utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Utilities.h; path = KALTURAPlayerSDK/Utilities.h; sourceTree = SOURCE_ROOT; }; BFC574A41997C296000511B8 /* libWViPhoneAPI.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libWViPhoneAPI.a; sourceTree = SOURCE_ROOT; }; BFFFA727182F9E31005B3B24 /* libKALTURAPlayerSDK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libKALTURAPlayerSDK.a; sourceTree = BUILT_PRODUCTS_DIR; }; + CFB27D189704B3679840E50C /* libPods-KALTURAPlayerSDK.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-KALTURAPlayerSDK.a"; sourceTree = BUILT_PRODUCTS_DIR; }; FB0B5AAC1C7FB3BE0067872E /* KPWidevineClassicHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPWidevineClassicHandler.h; sourceTree = ""; }; FB0B5AAD1C7FB3BE0067872E /* KPWidevineClassicHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPWidevineClassicHandler.m; sourceTree = ""; }; FB48BCB21C7B53E300B2E1B7 /* KPFairPlayHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPFairPlayHandler.h; sourceTree = ""; }; @@ -313,12 +318,31 @@ buildActionMask = 2147483647; files = ( B3410D481A6C12E300275F00 /* libWViPhoneAPI.a in Frameworks */, + EFE2C56E0569F6ABA07EFFBD /* libPods-KALTURAPlayerSDK.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 2BB5D0748F67A5576E4AFB2F /* Pods */ = { + isa = PBXGroup; + children = ( + 0B763B2703DBDB4330D555CB /* Pods-KALTURAPlayerSDK.debug.xcconfig */, + 0B94380941711CC7A6654CD9 /* Pods-KALTURAPlayerSDK.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 778FFEFEA9A63E802DCF7BF8 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CFB27D189704B3679840E50C /* libPods-KALTURAPlayerSDK.a */, + 9E2156ADFA169243A768B874 /* libPods-KALTURAPlayerSDKResources.a */, + ); + name = Frameworks; + sourceTree = ""; + }; B30BADEE1A223142008E5E67 /* ShareStrategies */ = { isa = PBXGroup; children = ( @@ -472,6 +496,8 @@ BFFFA72C182F9E31005B3B24 /* KALTURAPlayerSDK */, B372892F1A8787D00076DD33 /* KPlayerResources */, BFFFA728182F9E31005B3B24 /* Products */, + 2BB5D0748F67A5576E4AFB2F /* Pods */, + 778FFEFEA9A63E802DCF7BF8 /* Frameworks */, ); sourceTree = ""; }; @@ -567,10 +593,12 @@ isa = PBXNativeTarget; buildConfigurationList = BFFFA74C182F9E31005B3B24 /* Build configuration list for PBXNativeTarget "KALTURAPlayerSDK" */; buildPhases = ( + B09DAB7EA7BD3AF43FE02EE3 /* [CP] Check Pods Manifest.lock */, BFFFA723182F9E31005B3B24 /* Sources */, BFFFA724182F9E31005B3B24 /* Frameworks */, BFFFA725182F9E31005B3B24 /* CopyFiles */, B39BEC961A0BC7510085BA26 /* Resources */, + 95FDF13322A650D85620D461 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -647,6 +675,36 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 95FDF13322A650D85620D461 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-KALTURAPlayerSDK/Pods-KALTURAPlayerSDK-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + B09DAB7EA7BD3AF43FE02EE3 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; B3166DD41AF26C4D00E99B77 /* MultiPlatform Build */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -895,7 +953,7 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "\"$(SRCROOT)/WViPhoneAPI.h\"", ); - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LIBRARY_SEARCH_PATHS = ( "\"$(SRCROOT)/libWViPhoneAPI.a\"", "\"$(SRCROOT)/libGoogleIMA3.a\"", @@ -934,8 +992,8 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "\"$(SRCROOT)/WViPhoneAPI.h\"", ); - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - "IPHONEOS_DEPLOYMENT_TARGET[sdk=iphoneos*]" = 5.1.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + "IPHONEOS_DEPLOYMENT_TARGET[sdk=iphoneos*]" = 8.0; LIBRARY_SEARCH_PATHS = ( "\"$(SRCROOT)/libWViPhoneAPI.a\"", "\"$(SRCROOT)/libGoogleIMA3.a\"", @@ -951,6 +1009,7 @@ }; BFFFA74D182F9E31005B3B24 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 0B763B2703DBDB4330D555CB /* Pods-KALTURAPlayerSDK.debug.xcconfig */; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; @@ -973,6 +1032,7 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, ); + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", @@ -982,6 +1042,7 @@ OTHER_LDFLAGS = ( "-ObjC", "-all_load", + "$(inherited)", ); PRODUCT_NAME = KALTURAPlayerSDK; PUBLIC_HEADERS_FOLDER_PATH = "include/$(PROJECT_NAME)"; @@ -993,6 +1054,7 @@ }; BFFFA74E182F9E31005B3B24 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 0B94380941711CC7A6654CD9 /* Pods-KALTURAPlayerSDK.release.xcconfig */; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_CXX_LIBRARY = "compiler-default"; @@ -1015,7 +1077,8 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, ); - "IPHONEOS_DEPLOYMENT_TARGET[sdk=iphoneos*]" = 5.1.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + "IPHONEOS_DEPLOYMENT_TARGET[sdk=iphoneos*]" = 8.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", @@ -1024,6 +1087,7 @@ OTHER_LDFLAGS = ( "-ObjC", "-all_load", + "$(inherited)", ); PRODUCT_NAME = KALTURAPlayerSDK; PUBLIC_HEADERS_FOLDER_PATH = "include/$(PROJECT_NAME)"; diff --git a/KALTURAPlayerSDK.xcworkspace/contents.xcworkspacedata b/KALTURAPlayerSDK.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..b026aa68 --- /dev/null +++ b/KALTURAPlayerSDK.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/KALTURAPlayerSDK/IMAHandler.h b/KALTURAPlayerSDK/IMAHandler.h index 56d3a70c..182c8ec1 100644 --- a/KALTURAPlayerSDK/IMAHandler.h +++ b/KALTURAPlayerSDK/IMAHandler.h @@ -47,6 +47,7 @@ @property (nonatomic, strong) id webOpenerPresentingController; @property (nonatomic, strong) id webOpenerDelegate; +@property (nonatomic, assign) int bitrate; @end @@ -117,6 +118,10 @@ typedef NS_ENUM(NSInteger, IMAAdEventType){ * Single ad has finished. */ kIMAAdEvent_COMPLETE, + /** + * Cuepoints changed for VOD stream (only used for dynamic ad insertion). + */ + kIMAAdEvent_CUEPOINTS_CHANGED, /** * First quartile of a linear ad was reached. */ diff --git a/KALTURAPlayerSDK/KPAssetBuilder.m b/KALTURAPlayerSDK/KPAssetBuilder.m old mode 100644 new mode 100755 index c22c31df..7f0f6276 --- a/KALTURAPlayerSDK/KPAssetBuilder.m +++ b/KALTURAPlayerSDK/KPAssetBuilder.m @@ -46,15 +46,22 @@ -(void)setAssetParam:(NSString*)key toValue:(id)value { +(NSDictionary*)supportedMediaFormats { // We support FairPlay and Widevine Classic, as well as clear MP4 and HLS. - return @{ -#if TARGET_OS_SIMULATOR - // No DRM support in the simulator. - @"all": @[@"hls",@"mp4"], - @"drm": @[], -#else - @"all": @[@"hls",@"wvm",@"mp4"], - @"drm": @[@"hls",@"wvm"], + + NSMutableArray* all = [NSMutableArray arrayWithObjects:@"hls", @"mp4", nil]; + NSMutableArray* drm = [NSMutableArray array]; +#if !TARGET_OS_SIMULATOR + [drm addObject:@"hls"]; // FairPlay is built-in + +#if WIDEVINE_ENABLED + [drm addObject:@"wvm"]; // Widevine is optional + [all addObject:@"wvm"]; #endif + +#endif + + return @{ + @"all": [all copy], + @"drm": [drm copy], }; } diff --git a/KALTURAPlayerSDK/KPIMAPlayerViewController.m b/KALTURAPlayerSDK/KPIMAPlayerViewController.m index 1e3fc9ad..2278c8ec 100644 --- a/KALTURAPlayerSDK/KPIMAPlayerViewController.m +++ b/KALTURAPlayerSDK/KPIMAPlayerViewController.m @@ -11,6 +11,8 @@ #import "KPLog.h" #import "IMAHandler.h" +NSString * const KPAdStateDidChangeNotification = @"KPAdStateDidChangeNotification"; + @interface KPIMAPlayerViewController () /// Contains the params for the logic layer @@ -118,6 +120,7 @@ - (NSMutableDictionary *)adEventParams { _adsRenderingSettings = [NSClassFromString(@"IMAAdsRenderingSettings") new]; _adsRenderingSettings.webOpenerPresentingController = self; _adsRenderingSettings.webOpenerDelegate = _datasource; + _adsRenderingSettings.bitrate = 2048; // kbits } return _adsRenderingSettings; } @@ -173,10 +176,16 @@ - (void)adsLoader:(id)loader failedWithErrorData:(id)adsManager @@ -189,7 +198,11 @@ - (void)adsManager:(id)adsManager JSON:eventParams.allValues.firstObject]; NSLog(@"AdsManager error: %@", error.message); + self.view.hidden = YES; + [self.contentPlayer play]; + + [self postAdStateChangeNotification]; } #pragma mark AdsManager Delegates @@ -208,6 +221,7 @@ - (void)adsManager:(id)adsManager break; case kIMAAdEvent_STARTED: + [self postAdStateChangeNotification]; self.view.hidden = NO; self.adEventParams.duration = event.ad.duration; eventParams = self.adEventParams.toJSON.adStart; @@ -263,6 +277,7 @@ - (void)adsManagerDidRequestContentPause:(id)adsManager { - (void)adsManagerDidRequestContentResume:(id)adsManager { // The SDK is done playing ads (at least for now), so resume the content. + self.view.hidden = YES; [self.contentPlayer play]; NSDictionary *eventParams = ContentResumeRequestedKey.nullVal; [self.delegate player:nil @@ -301,5 +316,9 @@ - (void)resume { } } +- (void)postAdStateChangeNotification{ + [[NSNotificationCenter defaultCenter] postNotificationName:KPAdStateDidChangeNotification object:Nil]; +} + @end diff --git a/KALTURAPlayerSDK/KPViewController.h b/KALTURAPlayerSDK/KPViewController.h index e0a29c08..ed1bb207 100644 --- a/KALTURAPlayerSDK/KPViewController.h +++ b/KALTURAPlayerSDK/KPViewController.h @@ -20,6 +20,7 @@ #import "KPViewControllerProtocols.h" #import "KPPlayerConfig.h" #import "KPController.h" +#import "KPlayerFactory.h" @class KPViewController; @protocol KPViewControllerDelegate @@ -119,6 +120,8 @@ @property (nonatomic, strong) KPController *playerController; +@property (nonatomic, strong) KPlayerFactory *playerFactory; + /** * Block which notifies that the full screen has been toggeled, when assigning to this block the default full screen behaviour will be canceled and the full screen handling will be your reponsibility. */ diff --git a/KALTURAPlayerSDK/KPViewController.m b/KALTURAPlayerSDK/KPViewController.m index a094d56e..7b61a959 100644 --- a/KALTURAPlayerSDK/KPViewController.m +++ b/KALTURAPlayerSDK/KPViewController.m @@ -19,7 +19,6 @@ #import "NSString+Utilities.h" #import "DeviceParamsHandler.h" #import "KPIMAPlayerViewController.h" -#import "KPlayerFactory.h" #import "KPControlsView.h" #import "KCCPlayer.h" #import "KPController_Private.h" @@ -62,13 +61,13 @@ @interface KPViewController() controlsView; @property (nonatomic, copy) NSMutableDictionary *kPlayerEventsDict; @property (nonatomic, copy) NSMutableDictionary *kPlayerEvaluatedDict; @property (nonatomic, strong) KPShareManager *shareManager; -@property (nonatomic, strong) KPlayerFactory *playerFactory; @property (nonatomic) BOOL isModifiedFrame; @property (nonatomic) BOOL isFullScreenToggled; @property (nonatomic, strong) UIView *superView; @@ -976,13 +975,13 @@ - (void)openURL { - (void)player:(id)currentPlayer eventName:(NSString *)event value:(NSString *)value { __block KPMediaPlaybackState playbackState = KPMediaPlaybackStateUnknown; - if ([event isEqualToString:@"seeked"]) { - if (_seekedEventHandler) { - KPLogDebug(@"call seekedEventHandler"); - _seekedEventHandler(); - _seekedEventHandler = nil; - } - } +// if ([event isEqualToString:@"seeked"]) { +// if (_seekedEventHandler) { +// KPLogDebug(@"call seekedEventHandler"); +// _seekedEventHandler(); +// _seekedEventHandler = nil; +// } +// } void(^kPlayerStateBlock)() = @{ CanPlayKey: @@ -1034,6 +1033,22 @@ - (void)player:(id)currentPlayer eventName:(NSString *)event value:(NSS } [self.controlsView triggerEvent:event withValue:value]; + + if ([event isEqualToString:@"seeked"]) { + if (shouldReplayVideo) { + //[self.playerFactory.player setCurrentPlaybackTime:1.0]; + [self.playerFactory.player play]; + shouldReplayVideo = NO; + } + else if (_seekedEventHandler){ + KPLogDebug(@"call seekedEventHandler"); + _seekedEventHandler(); + _seekedEventHandler = nil; + } + } + else if([event isEqualToString:@"ended"]){ + shouldReplayVideo = YES; + } } - (void)playerPlaybackStateDidChange:(KPMediaPlaybackState)playbackState { diff --git a/KALTURAPlayerSDK/KPlayer.m b/KALTURAPlayerSDK/KPlayer.m index 45d40f2d..854ae67f 100644 --- a/KALTURAPlayerSDK/KPlayer.m +++ b/KALTURAPlayerSDK/KPlayer.m @@ -269,6 +269,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath [self.delegate player:self eventName:ErrorKey value:[self.error localizedDescription]]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"KPStatusFailedNotification" object:Nil]; break; case AVPlayerItemStatusReadyToPlay: { if (oldValue.intValue != newValue.intValue) { diff --git a/KALTURAPlayerSDK/WidevineClassicCDM.m b/KALTURAPlayerSDK/WidevineClassicCDM.m old mode 100644 new mode 100755 index adab90b1..abb35621 --- a/KALTURAPlayerSDK/WidevineClassicCDM.m +++ b/KALTURAPlayerSDK/WidevineClassicCDM.m @@ -22,22 +22,28 @@ -(NSString*)wvAssetPath; @implementation WidevineClassicCDM -#if TARGET_OS_SIMULATOR -// The widevine library does not support the simulator, so the following are stubs that do nothing. +#if TARGET_OS_SIMULATOR || !WIDEVINE_ENABLED +// If the Widevine Classic library is not present, we need to stub it, to satisfy the linker. WViOsApiStatus WV_Initialize(const WViOsApiStatusCallback callback, NSDictionary *settings ) { - assert(!"FATAL error: Widevine Classic is not avaialble for Simulator"); + + // Help developers find the misconfiguration by crashing. +#if TARGET_OS_SIMULATOR || DEBUG + assert(!"FATAL error: Widevine Classic is not avaialble"); +#endif + callback(WViOsApiEvent_InitializeFailed, @{}); return WViOsApiStatus_NotInitialized; } -WViOsApiStatus WV_Terminate() { return WViOsApiStatus_OK; } -WViOsApiStatus WV_SetCredentials( NSDictionary *settings ) { return WViOsApiStatus_OK; } -WViOsApiStatus WV_RegisterAsset (NSString *asset) { return WViOsApiStatus_OK; } -WViOsApiStatus WV_UnregisterAsset (NSString *asset) { return WViOsApiStatus_OK; } -WViOsApiStatus WV_QueryAssetStatus (NSString *asset ) { return WViOsApiStatus_OK; } -WViOsApiStatus WV_NowOnline () { return WViOsApiStatus_OK; } -WViOsApiStatus WV_RenewAsset (NSString *asset) { return WViOsApiStatus_OK; } -WViOsApiStatus WV_Play (NSString *asset, NSMutableString *url, NSData *authentication ) {[url setString:asset]; return WViOsApiStatus_OK; } -WViOsApiStatus WV_Stop () { return WViOsApiStatus_OK; } + +WViOsApiStatus WV_Terminate() { return WViOsApiStatus_NotInitialized; } +WViOsApiStatus WV_SetCredentials( NSDictionary *settings ) { return WViOsApiStatus_NotInitialized; } +WViOsApiStatus WV_RegisterAsset (NSString *asset) { return WViOsApiStatus_NotInitialized; } +WViOsApiStatus WV_UnregisterAsset (NSString *asset) { return WViOsApiStatus_NotInitialized; } +WViOsApiStatus WV_QueryAssetStatus (NSString *asset ) { return WViOsApiStatus_NotInitialized; } +WViOsApiStatus WV_NowOnline () { return WViOsApiStatus_NotInitialized; } +WViOsApiStatus WV_RenewAsset (NSString *asset) { return WViOsApiStatus_NotInitialized; } +WViOsApiStatus WV_Play (NSString *asset, NSMutableString *url, NSData *authentication ) {[url setString:asset]; return WViOsApiStatus_NotInitialized; } +WViOsApiStatus WV_Stop () { return WViOsApiStatus_NotInitialized; } NSString *NSStringFromWViOsApiEvent( WViOsApiEvent event ) { return @"Stub"; } #endif @@ -106,6 +112,12 @@ +(WViOsApiStatus)widevineCallbackWithEvent:(WViOsApiEvent)event attr:(NSDictiona wvInitialized = @NO; break; + case WViOsApiEvent_NullEvent: + if ((WViOsApiStatus)[attributes[@"WVStatusKey"] intValue] == WViOsApiStatus_FileNotPresent) { + //cdmEvent = KCDMEvent_FileNotFound; + } + break; + case WViOsApiEvent_EMMFailed: cdmEvent = KCDMEvent_LicenseFailed; break; @@ -223,16 +235,16 @@ +(void)registerLocalAsset:(NSString*)assetUri withLicenseUri:(NSString*)licenseU wvStatus = WViOsApiStatus_FileNotPresent; } - if (wvStatus == 4100) { + if ((int)wvStatus == 4100) { // Already registered -- not an error. wvStatus = WV_RenewAsset(assetPath); } if (wvStatus == WViOsApiStatus_FileNotPresent) { - [self widevineErrorWithEvent:WViOsApiStatus_NotRegistered status:wvStatus asset:assetPath]; + [self widevineErrorWithEvent:WViOsApiEvent_NullEvent status:wvStatus asset:assetPath]; return; } else if (wvStatus != WViOsApiStatus_OK) { - [self widevineErrorWithEvent:WViOsApiStatus_NotRegistered status:wvStatus asset:assetPath]; + [self widevineErrorWithEvent:WViOsApiEvent_NullEvent status:wvStatus asset:assetPath]; } WV_NowOnline(); WV_QueryAssetStatus(assetPath); diff --git a/Podfile b/Podfile new file mode 100644 index 00000000..37a8e14e --- /dev/null +++ b/Podfile @@ -0,0 +1,8 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '6.0' + +target 'KALTURAPlayerSDK' do + pod "google-cast-sdk", "2.10.4.1" + pod "GoogleAds-IMA-iOS-SDK-For-AdMob", "3.2.1" +end + diff --git a/README.md b/README.md index 52c38d80..44519e69 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ Using Kaltura player config.entryId = @"1_o426d3i4"; // Setting this property will cache the html pages in the limit size - config.cacheSize = 0.8; + config.cacheSize = 100; _player = [[KPViewController alloc] initWithConfiguration:config]; } return _player; diff --git a/KalturaPlayerSDK.podspec b/player-sdk-native-ios.podspec similarity index 88% rename from KalturaPlayerSDK.podspec rename to player-sdk-native-ios.podspec index 627586c2..1a5a0578 100644 --- a/KalturaPlayerSDK.podspec +++ b/player-sdk-native-ios.podspec @@ -5,14 +5,14 @@ Pod::Spec.new do |s| # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # -s.name = "KalturaPlayerSDK" +s.name = "player-sdk-native-ios" s.version = "2.3.5" s.summary = "The Kaltura player-sdk-native component enables embedding the kaltura player into native environments." #s.description = <<-DESC # The Kaltura player-sdk-native component enables embedding the kaltura player into native environments. # DESC -s.homepage = "https://github.com/kaltura/player-sdk-native-ios" +s.homepage = "https://github.com/SachinAhujaWork/player-sdk-native-ios" @@ -33,16 +33,19 @@ s.platform = :ios, "8.0" # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # -s.source = { :git => 'https://github.com/kaltura/player-sdk-native-ios.git', :tag => 'v' + s.version.to_s } -s.libraries = 'stdc++', 'z', 'System', 'stdc++.6', 'xml2.2', 'c++', 'stdc++.6.0.9', 'xml2', 'WViPhoneAPI' +s.source = { :git => 'https://github.com/SachinAhujaWork/player-sdk-native-ios.git' } +s.libraries = 'stdc++', 'z', 'System', 'stdc++.6', 'xml2.2', 'c++', 'stdc++.6.0.9', 'xml2' s.framework = 'MediaPlayer', 'SystemConfiguration', 'QuartzCore', 'CoreFoundation', 'AVFoundation', 'AudioToolbox', 'CFNetwork', 'AdSupport', 'WebKit', 'MessageUI', 'Social', 'MediaAccessibility', 'Foundation', 'CoreGraphics', 'UIKit' +s.xcconfig = {'OTHER_LDFLAGS' => '-ObjC -all_load'} + +s.dependency 'google-cast-sdk', '2.10.4.1' +s.dependency 'GoogleAds-IMA-iOS-SDK-For-AdMob', '3.2.1' s.requires_arc = true # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # s.source_files = "**/*.{h,m}", "PlayerSDK/KALTURAPlayerSDK/**/*.{h,m}" -s.vendored_library = 'libWViPhoneAPI.a' s.resource_bundle = { 'KALTURAPlayerSDKResources' => 'KALTURAPlayerSDK/*.{xib,plist}' } #s.exclude_files = "Classes/Exclude" @@ -59,5 +62,4 @@ s.resource_bundle = { 'KALTURAPlayerSDKResources' => 'KALTURAPlayerSDK/*.{xib,pl # s.preserve_paths = "FilesToSave", "MoreFilesToSave" -s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' } end