Skip to content

Commit

Permalink
Release 2.9.0
Browse files Browse the repository at this point in the history
* Fix programmatic seek latency and sequence issues
* Add Carthage binary project specification
* Clear customer metadata stored under `playerName` when `destroyPlayer` is called
* Add device detection info new properties for overrides support
* Update release documentation

Co-authored-by: Stephanie Zuniga <[email protected]>
Co-authored-by: Nidhi Kulkarni <[email protected]>
  • Loading branch information
3 people authored Jan 5, 2022
1 parent d5ba624 commit 2bf2124
Show file tree
Hide file tree
Showing 37 changed files with 188 additions and 52 deletions.
3 changes: 3 additions & 0 deletions MUXSDKStats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"2.9.0": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v2.9.0/MUXSDKStats.xcframework.zip"
}
12 changes: 6 additions & 6 deletions MUXSDKStats/MUXSDKStats.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
F4DCAD021DCA892E0094D94C /* Sources */,
F4DCAD031DCA892E0094D94C /* Frameworks */,
F4DCAD041DCA892E0094D94C /* Resources */,
266FD123E9622C8C5FB6D2E8 /* [CP] Embed Pods Frameworks */,
8F777D900EF5A05B463F59F0 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -419,7 +419,7 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
266FD123E9622C8C5FB6D2E8 /* [CP] Embed Pods Frameworks */ = {
8F777D900EF5A05B463F59F0 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand Down Expand Up @@ -554,7 +554,7 @@
INFOPLIST_FILE = MUXSDKStatsTv/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.8.0;
MARKETING_VERSION = 2.9.0;
MODULEMAP_FILE = "$(SRCROOT)/MUXSDKStatsTv/module.modulemap";
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.tvos.MUXSDKStatsTv;
Expand All @@ -581,7 +581,7 @@
INFOPLIST_FILE = MUXSDKStatsTv/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.8.0;
MARKETING_VERSION = 2.9.0;
MODULEMAP_FILE = "$(SRCROOT)/MUXSDKStatsTv/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.tvos.MUXSDKStatsTv;
PRODUCT_NAME = MUXSDKStats;
Expand Down Expand Up @@ -756,7 +756,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.8.0;
MARKETING_VERSION = 2.9.0;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.ios.MUXSDKStats;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -781,7 +781,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.8.0;
MARKETING_VERSION = 2.9.0;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.ios.MUXSDKStats;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
1 change: 1 addition & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKCustomerCustomDataStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@protocol MUXSDKCustomerCustomDataStoring

- (void) setCustomData:(nonnull MUXSDKCustomData *)customData forPlayerName:(nonnull NSString *)name;
- (void) removeDataForPlayerName:(nonnull NSString *)name;
- (MUXSDKCustomData *_Nullable) customDataForPlayerName:(nonnull NSString *)name;

@end
Expand Down
4 changes: 4 additions & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKCustomerCustomDataStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ - (void)setCustomData:(nonnull MUXSDKCustomData *)customData forPlayerName:(nonn
[self.store setValue:customData forKey:name];
}

- (void)removeDataForPlayerName:(nonnull NSString *)name {
[self.store removeObjectForKey:name];
}

- (MUXSDKCustomData *_Nullable) customDataForPlayerName:(nonnull NSString *)name {
return [self.store valueForKey:name];
}
Expand Down
1 change: 1 addition & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKCustomerPlayerDataStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@protocol MUXSDKCustomerPlayerDataStoring

- (void) setPlayerData:(nonnull MUXSDKCustomerPlayerData *)playerData forPlayerName:(nonnull NSString *)name;
- (void) removeDataForPlayerName:(nonnull NSString *)name;
- (MUXSDKCustomerPlayerData *_Nullable) playerDataForPlayerName:(nonnull NSString *)name;

@end
Expand Down
3 changes: 3 additions & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKCustomerPlayerDataStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ - (MUXSDKCustomerPlayerData *_Nullable) playerDataForPlayerName:(nonnull NSStrin
return [self.store valueForKey:name];
}

- (void)removeDataForPlayerName:(nonnull NSString *)name {
[self.store removeObjectForKey:name];
}
@end
1 change: 1 addition & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKCustomerVideoDataStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@protocol MUXSDKCustomerVideoDataStoring

- (void) setVideoData:(nonnull MUXSDKCustomerVideoData *)videoData forPlayerName:(nonnull NSString *)name;
- (void) removeDataForPlayerName:(nonnull NSString *)name;
- (MUXSDKCustomerVideoData *_Nullable) videoDataForPlayerName:(nonnull NSString *)name;

@end
Expand Down
4 changes: 4 additions & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKCustomerVideoDataStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ - (void) setVideoData:(nonnull MUXSDKCustomerVideoData *)videoData forPlayerName
[self.store setValue:videoData forKey:name];
}

- (void)removeDataForPlayerName:(nonnull NSString *)name {
[self.store removeObjectForKey:name];
}

- (MUXSDKCustomerVideoData *_Nullable) videoDataForPlayerName:(nonnull NSString *)name {
return [self.store valueForKey:name];
}
Expand Down
1 change: 1 addition & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKCustomerViewDataStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@protocol MUXSDKCustomerViewDataStoring

- (void) setViewData:(nonnull MUXSDKCustomerViewData *)viewData forPlayerName:(nonnull NSString *)name;
- (void) removeDataForPlayerName:(nonnull NSString *)name;
- (MUXSDKCustomerViewData *_Nullable) viewDataForPlayerName:(nonnull NSString *)name;

@end
Expand Down
4 changes: 4 additions & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKCustomerViewDataStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ - (void) setViewData:(nonnull MUXSDKCustomerViewData *)viewData forPlayerName:(n
[self.store setValue:viewData forKey:name];
}

- (void)removeDataForPlayerName:(nonnull NSString *)name {
[self.store removeObjectForKey:name];
}

- (MUXSDKCustomerViewData *_Nullable) viewDataForPlayerName:(nonnull NSString *)name {
return [self.store valueForKey:name];
}
Expand Down
12 changes: 6 additions & 6 deletions MUXSDKStats/MUXSDKStats/MUXSDKPlayerBinding.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// SDK constants.
NSString *const MUXSDKPluginName = @"apple-mux";
NSString *const MUXSDKPluginVersion = @"2.8.0";
NSString *const MUXSDKPluginVersion = @"2.9.0";

// Min number of seconds between timeupdate events. (100ms)
double MUXSDKMaxSecsBetweenTimeUpdate = 0.1;
Expand Down Expand Up @@ -903,11 +903,6 @@ - (void)computeDrift {
[self setPlayerPlayheadTime:_lastPlayheadTimeMs onPlayerData:playerData];
[seekingEvent setPlayerData:playerData];
[MUXSDKCore dispatchEvent:seekingEvent forPlayer:_name];

_seeking = NO;
MUXSDKSeekedEvent *seekedEvent = [[MUXSDKSeekedEvent alloc] init];
[seekedEvent setPlayerData:[self getPlayerData]];
[MUXSDKCore dispatchEvent:seekedEvent forPlayer:_name];
}
}
}
Expand Down Expand Up @@ -972,6 +967,11 @@ - (void)observeValueForKeyPath:(NSString*) path
[self dispatchPlay];
}
} else if (context == MUXSDKAVPlayerStatusObservationContext) {
if (_seeking && _state == MUXSDKPlayerStatePlaying && _player.currentItem.status == AVPlayerItemStatusReadyToPlay) {
// Dispatch seeked and playing events for programmatic seeks on playing status
[self dispatchPlaying];
}

if ([self isPlayerInErrorState]) {
[self dispatchError];
}
Expand Down
4 changes: 4 additions & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKPlayerBindingManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ - (id)init {

- (void) onPlayerDestroyed:(NSString *_Nonnull) name {
[self.playerReadyBindings removeObject:name];
[self.customerPlayerDataStore removeDataForPlayerName:name];
[self.customerVideoDataStore removeDataForPlayerName:name];
[self.customerViewDataStore removeDataForPlayerName:name];
[self.customerCustomDataStore removeDataForPlayerName:name];
}

- (BOOL) hasInitializedPlayerBinding:(NSString *) name {
Expand Down
6 changes: 6 additions & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKStats.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ + (MUXSDKViewerData *)buildViewerData {
[viewerData setViewerApplicationVersion:bundleVersion];
}
[viewerData setViewerDeviceManufacturer:@"Apple"];
[viewerData setMuxViewerDeviceManufacturer:@"Apple"];
struct utsname systemInfo;
uname(&systemInfo);
[viewerData setViewerDeviceModel:[NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]];
[viewerData setMuxViewerDeviceModel:[NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]];
NSString *deviceCategory = @"unknown";
NSString *osFamily = @"unknown";
switch ([[UIDevice currentDevice] userInterfaceIdiom]) {
Expand All @@ -137,6 +139,10 @@ + (MUXSDKViewerData *)buildViewerData {
[viewerData setViewerDeviceCategory:deviceCategory];
[viewerData setViewerOsFamily:osFamily];
[viewerData setViewerOsVersion:[[UIDevice currentDevice] systemVersion]];

[viewerData setMuxViewerDeviceCategory:deviceCategory];
[viewerData setMuxViewerOsFamily:osFamily];
[viewerData setMuxViewerOsVersion:[[UIDevice currentDevice] systemVersion]];
return viewerData;
}

Expand Down
51 changes: 50 additions & 1 deletion MUXSDKStats/MUXSDKStatsTests/MUXSDKStatsTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ - (void) assertPlayer:(NSString *)name dispatchedDataEventsAtIndex: (int) index
MUXSDKCustomData *customData;
dataEvent = (MUXSDKDataEvent * ) [MUXSDKCore eventAtIndex:index forPlayer:name];
customData = [dataEvent customData];
XCTAssertTrue([[customData toQuery] isEqualToDictionary:expected]);
if (expected != nil) {
XCTAssertTrue([[customData toQuery] isEqualToDictionary:expected]);
} else{
XCTAssertNil(customData);
}
}

- (void) assertPlayer:(NSString *)name dispatchedDataEventsAtIndex: (int) index withCustomerViewData:(NSDictionary *) expected {
Expand Down Expand Up @@ -445,6 +449,51 @@ - (void)testProgramChangeForAVPlayerViewController{
[MUXSDKStats destroyPlayer:playName];
}

- (void)testClearsCustomerMetadataOnDestroy {
MuxMockAVPlayerLayer *controller = [[MuxMockAVPlayerLayer alloc] init];
MUXSDKCustomerPlayerData *customerPlayerData = [[MUXSDKCustomerPlayerData alloc] initWithEnvironmentKey:@"YOUR_COMPANY_NAME"];
MUXSDKCustomerVideoData *customerVideoData = [[MUXSDKCustomerVideoData alloc] init];
[customerVideoData setVideoId:@"my-video-id"];
MUXSDKCustomData *customData = [[MUXSDKCustomData alloc] init];
[customData setCustomData1:@"foo"];
MUXSDKCustomerData *customerData = [[MUXSDKCustomerData alloc] initWithCustomerPlayerData:customerPlayerData
videoData:customerVideoData
viewData:nil
customData:customData];
NSString *playName = @"Player";
[MUXSDKStats monitorAVPlayerLayer:controller withPlayerName:playName customerData:customerData];
customerData = [[MUXSDKCustomerData alloc] initWithCustomerPlayerData:nil videoData:nil viewData:nil];
[MUXSDKStats setCustomerData:customerData forPlayer:playName];
NSArray *expectedEventTypes = @[MUXSDKPlaybackEventViewInitEventType,
MUXSDKDataEventType,
MUXSDKPlaybackEventPlayerReadyEventType
];
[self assertPlayer:playName dispatchedEventTypes:expectedEventTypes];
[self assertPlayer:playName dispatchedDataEventsAtIndex:1 withCustomerVideoData:@{@"vid": @"my-video-id"}];
[self assertPlayer:playName dispatchedDataEventsAtIndex:1 withCustomData:@{@"c1" : @"foo"}];

[MUXSDKStats destroyPlayer:playName];
MUXSDKCustomerVideoData *updatedVideoData = [[MUXSDKCustomerVideoData alloc] init];
[updatedVideoData setVideoId:@"my-video-id-2"];
MUXSDKCustomerData *updatedCustomerData = [[MUXSDKCustomerData alloc] initWithCustomerPlayerData:customerPlayerData
videoData:updatedVideoData
viewData:nil
customData:nil];
[MUXSDKStats monitorAVPlayerLayer:controller withPlayerName:playName customerData:updatedCustomerData];
expectedEventTypes = @[MUXSDKPlaybackEventViewInitEventType,
MUXSDKDataEventType,
MUXSDKPlaybackEventPlayerReadyEventType,
MUXSDKPlaybackEventViewEndEventType,
MUXSDKPlaybackEventViewInitEventType,
MUXSDKDataEventType,
MUXSDKPlaybackEventPlayerReadyEventType
];
[self assertPlayer:playName dispatchedEventTypes:expectedEventTypes];
[self assertPlayer:playName dispatchedDataEventsAtIndex:5 withCustomerVideoData:@{@"vid": @"my-video-id-2"}];
[self assertPlayer:playName dispatchedDataEventsAtIndex:5 withCustomData:nil];
[MUXSDKStats destroyPlayer:playName];
}

- (void)testUpdateCustomerDataWithCustomData {
MuxMockAVPlayerLayer *controller = [[MuxMockAVPlayerLayer alloc] init];
MUXSDKCustomerPlayerData *customerPlayerData = [[MUXSDKCustomerPlayerData alloc] initWithEnvironmentKey:@"YOUR_COMPANY_NAME"];
Expand Down
8 changes: 4 additions & 4 deletions MUXSDKStats/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ target 'MUXSDKStats' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for MUXSDKStats
pod 'Mux-Stats-Core', '~>3.6'
pod 'Mux-Stats-Core', '~>3.8'

target 'MUXSDKStatsTests' do
inherit! :search_paths
# Pods for testing
pod 'Mux-Stats-Core', '~>3.6'
pod 'Mux-Stats-Core', '~>3.8'
end

end

target 'MUXSDKStatsTv' do
platform :tvos, '9.0'
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for MUXSDKStatsTv
pod 'Mux-Stats-Core', '~>3.6'
pod 'Mux-Stats-Core', '~>3.8'
end
8 changes: 4 additions & 4 deletions MUXSDKStats/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- Mux-Stats-Core (3.6.0)
- Mux-Stats-Core (3.8.0)

DEPENDENCIES:
- Mux-Stats-Core (~> 3.6)
- Mux-Stats-Core (~> 3.8)

SPEC REPOS:
trunk:
- Mux-Stats-Core

SPEC CHECKSUMS:
Mux-Stats-Core: 03cde928286545cf8dfe77fad0ebbb11a1b040f3
Mux-Stats-Core: cb72e59db58a12f04a54a7634567f20f16b9453a

PODFILE CHECKSUM: 2463956ba68f1f0de0fc1f3f9d41972d515d7345
PODFILE CHECKSUM: 73ee487459a1bf5b64b99b9823e6f6eb1744d2c2

COCOAPODS: 1.11.2
4 changes: 2 additions & 2 deletions Mux-Stats-AVPlayer.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = 'Mux-Stats-AVPlayer'

s.version = '2.8.0'
s.version = '2.9.0'
s.source = { :git => 'https://github.com/muxinc/mux-stats-sdk-avplayer.git',
:tag => "v#{s.version}" }

Expand All @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.license = 'Apache 2.0'
s.author = { 'Mux' => '[email protected]' }

s.dependency 'Mux-Stats-Core', '~>3.6'
s.dependency 'Mux-Stats-Core', '~>3.8'

s.ios.deployment_target = '9.0'
s.ios.vendored_frameworks = 'XCFramework/MUXSDKStats.xcframework'
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let package = Package(
.package(
name: "MuxCore",
url: "https://github.com/muxinc/stats-sdk-objc.git",
from: "3.6.0"
from: "3.8.0"
)
],
targets: [
Expand Down
3 changes: 2 additions & 1 deletion README_INTERNAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
1. Bump version in XCode "General" for target: MUXSDKStats
1. Bump version in XCode "General" for target: MUXSDKStatsTv
1. Bump version in MUXSDKStats/MUXSDKStats/MUXSDKPlayerBinding.m
1. Bump version in Package.swift (if the dependecy on Mux-Stats-Core has changed)
1. Bump version in Package.swift (if the dependency on Mux-Stats-Core has changed)
1. Update the version and url in project specification file MUXSDKStats.json for Carthage
1. Push to your feature branch in Github
1. Download artifact from the Build step of the [Buildkite pipeline](https://buildkite.com/mux/stats-sdk-avplayer).
![Screen Shot 2021-04-13 at 8 27 29 PM](https://user-images.githubusercontent.com/1444681/114637753-14089180-9c98-11eb-87df-05e894d066d9.png) Make sure this is from the latest commit on your branch.
Expand Down
14 changes: 7 additions & 7 deletions XCFramework/MUXSDKStats.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>tvos-arm64</string>
<string>ios-arm64_x86_64-maccatalyst</string>
<key>LibraryPath</key>
<string>MUXSDKStats.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
Expand All @@ -62,18 +65,15 @@
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-maccatalyst</string>
<string>tvos-arm64</string>
<key>LibraryPath</key>
<string>MUXSDKStats.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
<string>tvos</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</data>
<key>Info.plist</key>
<data>
T64SDZl2CsLHJqdCbjJO4I4xEJY=
Jgf/sdW+h6CFJf6j8p2ya1+/sQk=
</data>
<key>Modules/module.modulemap</key>
<data>
Expand Down
Binary file not shown.
Loading

0 comments on commit 2bf2124

Please sign in to comment.