Skip to content

Commit

Permalink
add MUXSDKStats updateCustomerData method
Browse files Browse the repository at this point in the history
* adds MUXSDKStats.updateCustomerDataForPlayer:withPlayerData:withVideoData

This methods can be used to set or update properties after the
SDK has been initialized
  • Loading branch information
dylanjha committed Oct 17, 2019
1 parent 1b2659b commit 37a9688
Show file tree
Hide file tree
Showing 24 changed files with 129 additions and 7 deletions.
Binary file not shown.
10 changes: 10 additions & 0 deletions Frameworks/iOS/fat/MUXSDKStats.framework/Headers/MUXSDKStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,14 @@ FOUNDATION_EXPORT
*/
+ (void)programChangeForPlayer:(nonnull NSString *)name withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

/*!
@method updateCustomerData:forPlayer:withPlayerData:withVideoData
@abstract allows videoData to be set or updated for the player
@param name The name of the player to update
@param playerData A MUXSDKCustomerPlayerData object with video metadata
@param videoData A MUXSDKCustomerVideoData object with video metadata
@discussion Use this method after you have already initialized the Mux SDK at any time before the player has been destroyed. Pass in either videoData or playerData.
*/
+ (void)updateCustomerDataForPlayer:(nonnull NSString *)name withPlayerData:(nullable MUXSDKCustomerPlayerData *)playerData withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

@end
Binary file modified Frameworks/iOS/fat/MUXSDKStats.framework/MUXSDKStats
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions Frameworks/iOS/release/MUXSDKStats.framework/Headers/MUXSDKStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,14 @@ FOUNDATION_EXPORT
*/
+ (void)programChangeForPlayer:(nonnull NSString *)name withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

/*!
@method updateCustomerData:forPlayer:withPlayerData:withVideoData
@abstract allows videoData to be set or updated for the player
@param name The name of the player to update
@param playerData A MUXSDKCustomerPlayerData object with video metadata
@param videoData A MUXSDKCustomerVideoData object with video metadata
@discussion Use this method after you have already initialized the Mux SDK at any time before the player has been destroyed. Pass in either videoData or playerData.
*/
+ (void)updateCustomerDataForPlayer:(nonnull NSString *)name withPlayerData:(nullable MUXSDKCustomerPlayerData *)playerData withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

@end
Binary file modified Frameworks/iOS/release/MUXSDKStats.framework/MUXSDKStats
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,14 @@ FOUNDATION_EXPORT
*/
+ (void)programChangeForPlayer:(nonnull NSString *)name withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

/*!
@method updateCustomerData:forPlayer:withPlayerData:withVideoData
@abstract allows videoData to be set or updated for the player
@param name The name of the player to update
@param playerData A MUXSDKCustomerPlayerData object with video metadata
@param videoData A MUXSDKCustomerVideoData object with video metadata
@discussion Use this method after you have already initialized the Mux SDK at any time before the player has been destroyed. Pass in either videoData or playerData.
*/
+ (void)updateCustomerDataForPlayer:(nonnull NSString *)name withPlayerData:(nullable MUXSDKCustomerPlayerData *)playerData withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

@end
Binary file modified Frameworks/iOS/simulator/MUXSDKStats.framework/MUXSDKStats
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</data>
<key>Headers/MUXSDKStats.h</key>
<data>
hpJjIlmQKaJSLEx2OMwYcNHASH0=
S9PdZ/OgsJQlp2nQojF9ilpmfE8=
</data>
<key>Info.plist</key>
<data>
Expand Down Expand Up @@ -38,11 +38,11 @@
<dict>
<key>hash</key>
<data>
hpJjIlmQKaJSLEx2OMwYcNHASH0=
S9PdZ/OgsJQlp2nQojF9ilpmfE8=
</data>
<key>hash2</key>
<data>
k6dEI0sz2Ym7t2Jif4GQKZy5NiX1aNWXeWiiwhC/6Eg=
9/mUO+ra23XJQhg/Zhf400L8md068bldwV9bqouyVEo=
</data>
</dict>
<key>Modules/module.modulemap</key>
Expand Down
Binary file not shown.
10 changes: 10 additions & 0 deletions Frameworks/tvOS/fat/MUXSDKStatsTv.framework/Headers/MUXSDKStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,14 @@ FOUNDATION_EXPORT
*/
+ (void)programChangeForPlayer:(nonnull NSString *)name withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

/*!
@method updateCustomerData:forPlayer:withPlayerData:withVideoData
@abstract allows videoData to be set or updated for the player
@param name The name of the player to update
@param playerData A MUXSDKCustomerPlayerData object with video metadata
@param videoData A MUXSDKCustomerVideoData object with video metadata
@discussion Use this method after you have already initialized the Mux SDK at any time before the player has been destroyed. Pass in either videoData or playerData.
*/
+ (void)updateCustomerDataForPlayer:(nonnull NSString *)name withPlayerData:(nullable MUXSDKCustomerPlayerData *)playerData withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

@end
Binary file modified Frameworks/tvOS/fat/MUXSDKStatsTv.framework/MUXSDKStatsTv
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,14 @@ FOUNDATION_EXPORT
*/
+ (void)programChangeForPlayer:(nonnull NSString *)name withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

/*!
@method updateCustomerData:forPlayer:withPlayerData:withVideoData
@abstract allows videoData to be set or updated for the player
@param name The name of the player to update
@param playerData A MUXSDKCustomerPlayerData object with video metadata
@param videoData A MUXSDKCustomerVideoData object with video metadata
@discussion Use this method after you have already initialized the Mux SDK at any time before the player has been destroyed. Pass in either videoData or playerData.
*/
+ (void)updateCustomerDataForPlayer:(nonnull NSString *)name withPlayerData:(nullable MUXSDKCustomerPlayerData *)playerData withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

@end
Binary file modified Frameworks/tvOS/release/MUXSDKStatsTv.framework/MUXSDKStatsTv
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,14 @@ FOUNDATION_EXPORT
*/
+ (void)programChangeForPlayer:(nonnull NSString *)name withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

/*!
@method updateCustomerData:forPlayer:withPlayerData:withVideoData
@abstract allows videoData to be set or updated for the player
@param name The name of the player to update
@param playerData A MUXSDKCustomerPlayerData object with video metadata
@param videoData A MUXSDKCustomerVideoData object with video metadata
@discussion Use this method after you have already initialized the Mux SDK at any time before the player has been destroyed. Pass in either videoData or playerData.
*/
+ (void)updateCustomerDataForPlayer:(nonnull NSString *)name withPlayerData:(nullable MUXSDKCustomerPlayerData *)playerData withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

@end
Binary file modified Frameworks/tvOS/simulator/MUXSDKStatsTv.framework/MUXSDKStatsTv
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</data>
<key>Headers/MUXSDKStats.h</key>
<data>
hpJjIlmQKaJSLEx2OMwYcNHASH0=
S9PdZ/OgsJQlp2nQojF9ilpmfE8=
</data>
<key>Headers/MUXSDKStatsTv.h</key>
<data>
Expand Down Expand Up @@ -42,11 +42,11 @@
<dict>
<key>hash</key>
<data>
hpJjIlmQKaJSLEx2OMwYcNHASH0=
S9PdZ/OgsJQlp2nQojF9ilpmfE8=
</data>
<key>hash2</key>
<data>
k6dEI0sz2Ym7t2Jif4GQKZy5NiX1aNWXeWiiwhC/6Eg=
9/mUO+ra23XJQhg/Zhf400L8md068bldwV9bqouyVEo=
</data>
</dict>
<key>Headers/MUXSDKStatsTv.h</key>
Expand Down
8 changes: 7 additions & 1 deletion MUXSDKStats/MUXSDKStats.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,12 @@
};
F4DCACFC1DCA892E0094D94C = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = CX6AHWLHM6;
ProvisioningStyle = Automatic;
};
F4DCAD051DCA892E0094D94C = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = CX6AHWLHM6;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -597,8 +599,9 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 2299324CA6DB1DBCB21FE15C /* Pods-MUXSDKStats.debug.xcconfig */;
buildSettings = {
CODE_SIGN_IDENTITY = "";
CODE_SIGN_IDENTITY = "iPhone Developer";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = CX6AHWLHM6;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -626,6 +629,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = CX6AHWLHM6;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -647,6 +651,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 7FEF662BE45E805333B7371A /* Pods-MUXSDKStatsTests.debug.xcconfig */;
buildSettings = {
DEVELOPMENT_TEAM = CX6AHWLHM6;
INFOPLIST_FILE = MUXSDKStatsTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.ios.MUXSDKStatsTests;
Expand All @@ -658,6 +663,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = D55847390AE2D6C375E7535C /* Pods-MUXSDKStatsTests.release.xcconfig */;
buildSettings = {
DEVELOPMENT_TEAM = CX6AHWLHM6;
INFOPLIST_FILE = MUXSDKStatsTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.ios.MUXSDKStatsTests;
Expand Down
10 changes: 10 additions & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,14 @@ FOUNDATION_EXPORT
*/
+ (void)programChangeForPlayer:(nonnull NSString *)name withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

/*!
@method updateCustomerData:forPlayer:withPlayerData:withVideoData
@abstract allows videoData to be set or updated for the player
@param name The name of the player to update
@param playerData A MUXSDKCustomerPlayerData object with video metadata
@param videoData A MUXSDKCustomerVideoData object with video metadata
@discussion Use this method after you have already initialized the Mux SDK at any time before the player has been destroyed. Pass in either videoData or playerData.
*/
+ (void)updateCustomerDataForPlayer:(nonnull NSString *)name withPlayerData:(nullable MUXSDKCustomerPlayerData *)playerData withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

@end
14 changes: 14 additions & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKStats.m
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,18 @@ + (void)programChangeForPlayer:(nonnull NSString *)name withVideoData:(nullable
}
}

+ (void)updateCustomerDataForPlayer:(nonnull NSString *)name withPlayerData:(nullable MUXSDKCustomerPlayerData *)playerData withVideoData:(nullable MUXSDKCustomerVideoData *)videoData {
MUXSDKPlayerBinding *player = [_viewControllers valueForKey:name];
if (!player) return;
if (!playerData && !videoData) return;
MUXSDKDataEvent *dataEvent = [MUXSDKDataEvent new];
if (playerData) {
[dataEvent setCustomerPlayerData:playerData];
}
if (videoData) {
[dataEvent setCustomerVideoData:videoData];
}
[MUXSDKCore dispatchEvent:dataEvent forPlayer:name];
}

@end
32 changes: 32 additions & 0 deletions MUXSDKStats/MUXSDKStatsTests/MUXSDKStatsTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,36 @@ - (void)testVideoChangeForAVPlayerLayer{
[MUXSDKStats destroyPlayer:playName];
}

- (void)testupdateCustomerDataWithNulls{
MuxMockAVPlayerLayer *controller = [[MuxMockAVPlayerLayer alloc] init];
MUXSDKCustomerPlayerData *customerPlayerData = [[MUXSDKCustomerPlayerData alloc] initWithEnvironmentKey:@"YOUR_COMPANY_NAME"];
MUXSDKCustomerVideoData *customerVideoData = [[MUXSDKCustomerVideoData alloc] init];
NSString *playName = @"Player";
[MUXSDKStats monitorAVPlayerLayer:controller withPlayerName:playName playerData:customerPlayerData videoData:customerVideoData];
[MUXSDKStats updateCustomerDataForPlayer:playName withPlayerData:NULL withVideoData:NULL];
[MUXSDKStats destroyPlayer:playName];
}

- (void)testupdateCustomerDataWithPlayerDataAndNullVideoData{
MuxMockAVPlayerLayer *controller = [[MuxMockAVPlayerLayer alloc] init];
MUXSDKCustomerPlayerData *customerPlayerData = [[MUXSDKCustomerPlayerData alloc] initWithEnvironmentKey:@"YOUR_COMPANY_NAME"];
MUXSDKCustomerVideoData *customerVideoData = [[MUXSDKCustomerVideoData alloc] init];
NSString *playName = @"Player";
[MUXSDKStats monitorAVPlayerLayer:controller withPlayerName:playName playerData:customerPlayerData videoData:customerVideoData];
[customerPlayerData setPlayerVersion:@"playerVersionV1"];
[MUXSDKStats updateCustomerDataForPlayer:playName withPlayerData:customerPlayerData withVideoData:NULL];
[MUXSDKStats destroyPlayer:playName];
}

- (void)testupdateCustomerDataWithNullPlayerDataAndVideoData{
MuxMockAVPlayerLayer *controller = [[MuxMockAVPlayerLayer alloc] init];
MUXSDKCustomerPlayerData *customerPlayerData = [[MUXSDKCustomerPlayerData alloc] initWithEnvironmentKey:@"YOUR_COMPANY_NAME"];
MUXSDKCustomerVideoData *customerVideoData = [[MUXSDKCustomerVideoData alloc] init];
NSString *playName = @"Player";
[MUXSDKStats monitorAVPlayerLayer:controller withPlayerName:playName playerData:customerPlayerData videoData:customerVideoData];
[customerVideoData setVideoTitle:@"Updated VideoTitle"];
[MUXSDKStats updateCustomerDataForPlayer:playName withPlayerData:NULL withVideoData:customerVideoData];
[MUXSDKStats destroyPlayer:playName];
}

@end

0 comments on commit 37a9688

Please sign in to comment.