Skip to content

Commit

Permalink
Release 3.0.0 (#167)
Browse files Browse the repository at this point in the history
## Updates

* Add fields to `CustomerViewerData`allowing them to override detected device metadata values (#164)

## Breaking

* Due to XCode 14, support for iOS and tvOS versions 9 and 10 have been removed. This may result in a warning for client applications with deployment versions below iOS/tvOS 11. For more information [see the last 'Deprecations' block in the release notes](https://developer.apple.com/documentation/Xcode-Release-Notes/xcode-14-release-notes).

## Improvements

* Update to MuxCore 4.0.0, XCode 14
* Improve HLS/DASH segment request metrics (#165)

## MuxCore Updates
    
* Add Request ID metadata property to BandwidthMetricData
* Add Customer Overrides for Device Metadata
  • Loading branch information
daytime-em authored Nov 7, 2022
1 parent 39de1b2 commit 0a13634
Show file tree
Hide file tree
Showing 43 changed files with 286 additions and 198 deletions.
24 changes: 0 additions & 24 deletions .buildkite/pipeline.yml

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
build:
name: Run unit tests and build the SDK
runs-on: macos-10.15
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -17,9 +17,9 @@ jobs:
echo "Creating symlink of the iOS 14.1 runtime..."
sudo ln -s /Applications/Xcode_12.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 14.1.simruntime
- name: "Unit Tests"
run: ".buildkite/unit-tests.sh"
run: ".github/workflows/scripts/unit-tests.sh"
- name: "🔨 Build"
run: ".buildkite/build.sh"
run: ".github/workflows/scripts/build.sh"
- name: "Upload framework artifact"
uses: actions/upload-artifact@v2
with:
Expand All @@ -28,7 +28,7 @@ jobs:
tests:
name: Test the SDK with a Demo App
needs: build
runs-on: macos-10.15
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -46,7 +46,7 @@ jobs:
run: "apps/DemoApp/run-tests.sh"
build-static:
name: Build static SDK
runs-on: macos-10.15
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -57,7 +57,7 @@ jobs:
echo "Creating symlink of the iOS 14.1 runtime..."
sudo ln -s /Applications/Xcode_12.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 14.1.simruntime
- name: "🔨 Build Static"
run: ".buildkite/build-static.sh"
run: ".github/workflows/scripts/build-static.sh"
- name: "Upload framework artifact"
uses: actions/upload-artifact@v2
with:
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ PROJECT=MUXSDKStats/MUXSDKStats.xcworkspace
xcodebuild clean test \
-workspace $PROJECT \
-scheme MUXSDKStats \
-destination 'platform=iOS Simulator,name=iPhone 11,OS=14.1' \
-destination 'platform=iOS Simulator,OS=16.0,name=iPhone 14 Pro Max'
3 changes: 2 additions & 1 deletion MUXSDKStats.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"2.12.1": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v2.12.1/MUXSDKStats.xcframework.zip",
"2.13.0": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v2.13.0/MUXSDKStats.xcframework.zip",
"2.13.1": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v2.13.1/MUXSDKStats.xcframework.zip",
"2.13.2": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v2.13.2/MUXSDKStats.xcframework.zip"
"2.13.2": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v2.13.2/MUXSDKStats.xcframework.zip",
"3.0.0": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v3.0.0/MUXSDKStats.xcframework.zip"
}
56 changes: 29 additions & 27 deletions MUXSDKStats/MUXSDKStats.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
02EB9E2C23E896790007E1CD /* MUXSDKCustomerVideoDataStore.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MUXSDKCustomerVideoDataStore.m; sourceTree = "<group>"; };
0E83ED48E98E5C3BB2EFEA8E /* libPods-MUXSDKStatsTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-MUXSDKStatsTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
19014A7CD740B7E3AC1FEACE /* Pods-MUXSDKStatsTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MUXSDKStatsTests.release.xcconfig"; path = "Target Support Files/Pods-MUXSDKStatsTests/Pods-MUXSDKStatsTests.release.xcconfig"; sourceTree = "<group>"; };
350F766328FDCD8D008F520F /* MUXSDKStats+Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MUXSDKStats+Internal.h"; sourceTree = "<group>"; };
6F30D4F978B53C0CE033EBB7 /* Pods-MUXSDKStats.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MUXSDKStats.debug.xcconfig"; path = "Target Support Files/Pods-MUXSDKStats/Pods-MUXSDKStats.debug.xcconfig"; sourceTree = "<group>"; };
7A31A9BB4AB17C7F23036EBB /* Pods-MUXSDKStatsTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MUXSDKStatsTests.debug.xcconfig"; path = "Target Support Files/Pods-MUXSDKStatsTests/Pods-MUXSDKStatsTests.debug.xcconfig"; sourceTree = "<group>"; };
83CD318BE8A3940DA9B8905C /* Pods-MUXSDKStats.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MUXSDKStats.release.xcconfig"; path = "Target Support Files/Pods-MUXSDKStats/Pods-MUXSDKStats.release.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -223,6 +224,7 @@
F4DCAD0A1DCA892E0094D94C /* MUXSDKStatsTests */ = {
isa = PBXGroup;
children = (
350F766328FDCD8D008F520F /* MUXSDKStats+Internal.h */,
02729E1A23E8F31B0037F0E9 /* Utils */,
F4DCAD0B1DCA892E0094D94C /* MUXSDKStatsTests.m */,
F4DCAD0D1DCA892E0094D94C /* Info.plist */,
Expand Down Expand Up @@ -316,7 +318,7 @@
F4DCAD021DCA892E0094D94C /* Sources */,
F4DCAD031DCA892E0094D94C /* Frameworks */,
F4DCAD041DCA892E0094D94C /* Resources */,
F5876A42AC3B9F00CB932EB4 /* [CP] Embed Pods Frameworks */,
3AA3507C3DDFD40977FB6B6C /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -419,29 +421,25 @@
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;
};
BC82C7A77B5183ED420EE64C /* [CP] Check Pods Manifest.lock */ = {
3AA3507C3DDFD40977FB6B6C /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MUXSDKStatsTests/Pods-MUXSDKStatsTests-frameworks.sh",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/Mux-Stats-Core/MuxCore.framework/MuxCore",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-MUXSDKStats-checkManifestLockResult.txt",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MuxCore.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MUXSDKStatsTests/Pods-MUXSDKStatsTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
C88DCF5B1174B9ED42D57612 /* [CP] Check Pods Manifest.lock */ = {
BC82C7A77B5183ED420EE64C /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -456,29 +454,33 @@
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-MUXSDKStatsTv-checkManifestLockResult.txt",
"$(DERIVED_FILE_DIR)/Pods-MUXSDKStats-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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;
};
F5876A42AC3B9F00CB932EB4 /* [CP] Embed Pods Frameworks */ = {
C88DCF5B1174B9ED42D57612 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-MUXSDKStatsTests/Pods-MUXSDKStatsTests-frameworks.sh",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/Mux-Stats-Core/MuxCore.framework/MuxCore",
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MuxCore.framework",
"$(DERIVED_FILE_DIR)/Pods-MUXSDKStatsTv-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MUXSDKStatsTests/Pods-MUXSDKStatsTests-frameworks.sh\"\n";
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;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -554,15 +556,15 @@
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.13.2;
MARKETING_VERSION = 3.0.0;
MODULEMAP_FILE = "$(SRCROOT)/MUXSDKStatsTv/module.modulemap";
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.tvos.MUXSDKStatsTv;
PRODUCT_NAME = MUXSDKStats;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
};
name = Debug;
};
Expand All @@ -581,14 +583,14 @@
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.13.2;
MARKETING_VERSION = 3.0.0;
MODULEMAP_FILE = "$(SRCROOT)/MUXSDKStatsTv/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.tvos.MUXSDKStatsTv;
PRODUCT_NAME = MUXSDKStats;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 11.0;
};
name = Release;
};
Expand Down Expand Up @@ -756,9 +758,9 @@
);
INFOPLIST_FILE = MUXSDKStats/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.13.2;
MARKETING_VERSION = 3.0.0;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.ios.MUXSDKStats;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -781,9 +783,9 @@
"GCC_PREPROCESSOR_DEFINITIONS[sdk=appletvos*]" = "TVOS=1";
INFOPLIST_FILE = MUXSDKStats/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 2.13.2;
MARKETING_VERSION = 3.0.0;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.ios.MUXSDKStats;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
3 changes: 2 additions & 1 deletion 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.13.2";
NSString *const MUXSDKPluginVersion = @"3.0.0";
NSString *const MUXSessionDataPrefix = @"io.litix.data.";

// Min number of seconds between timeupdate events. (100ms)
Expand Down Expand Up @@ -237,6 +237,7 @@ - (void) calculateBandwidthMetricFromAccessLog:(AVPlayerItemAccessLog *) log {
loadData.requestBytesLoaded = [NSNumber numberWithLong: event.numberOfBytesTransferred - _lastTransferredBytes];
loadData.requestResponseHeaders = nil;
loadData.requestHostName = [self getHostName:event.URI];
loadData.requestUrl = event.URI;
loadData.requestCurrentLevel = nil;
loadData.requestMediaStartTime = nil;
loadData.requestMediaDuration = nil;
Expand Down
56 changes: 36 additions & 20 deletions MUXSDKStats/MUXSDKStats/MUXSDKStats.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,41 +108,56 @@ + (MUXSDKViewerData *)buildViewerData {
} else if (bundleVersion) {
[viewerData setViewerApplicationVersion:bundleVersion];
}
[viewerData setViewerDeviceManufacturer:@"Apple"];
[viewerData setMuxViewerDeviceManufacturer:@"Apple"];
NSString *systemDeviceCategory = @"unknown";
NSString *systemOsFamily = @"unknown";
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";
NSString *systemDeviceModel = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
NSString *systemOsVersion = [[UIDevice currentDevice] systemVersion];
switch ([[UIDevice currentDevice] userInterfaceIdiom]) {
case UIUserInterfaceIdiomTV:
deviceCategory = @"tv";
osFamily = @"tvOS";
systemDeviceCategory = @"tv";
systemOsFamily = @"tvOS";
break;
case UIUserInterfaceIdiomPad:
deviceCategory = @"tablet";
osFamily = @"iOS";
systemDeviceCategory = @"tablet";
systemOsFamily = @"iOS";
break;
case UIUserInterfaceIdiomPhone:
deviceCategory = @"phone";
osFamily = @"iOS";
systemDeviceCategory = @"phone";
systemOsFamily = @"iOS";
break;
case UIUserInterfaceIdiomCarPlay:
deviceCategory = @"car";
osFamily = @"CarPlay";
systemDeviceCategory = @"car";
systemOsFamily = @"CarPlay";
break;
default:
break;
}
[viewerData setViewerDeviceCategory:deviceCategory];
[viewerData setViewerOsFamily:osFamily];
[viewerData setViewerOsVersion:[[UIDevice currentDevice] systemVersion]];

[viewerData setMuxViewerDeviceCategory:deviceCategory];
[viewerData setMuxViewerOsFamily:osFamily];
[viewerData setMuxViewerOsVersion:[[UIDevice currentDevice] systemVersion]];
// Detected values for device metadata
[viewerData setMuxViewerDeviceModel:systemDeviceModel];
[viewerData setMuxViewerDeviceCategory:systemDeviceCategory];
[viewerData setMuxViewerOsFamily:systemOsFamily];
[viewerData setMuxViewerOsVersion:systemOsVersion];
[viewerData setMuxViewerDeviceManufacturer:@"Apple"];

// Overridden values for device metadata
if(_customerViewerData.viewerDeviceModel) {
[viewerData setViewerDeviceModel:_customerViewerData.viewerDeviceModel];
}
if(_customerViewerData.viewerDeviceCategory) {
[viewerData setViewerDeviceCategory:_customerViewerData.viewerDeviceCategory];
}
if(_customerViewerData.viewerOsFamily) {
[viewerData setViewerOsFamily:_customerViewerData.viewerOsFamily];
}
if(_customerViewerData.viewerOsVersion) {
[viewerData setViewerOsVersion:_customerViewerData.viewerOsVersion];
}
if(_customerViewerData.viewerDeviceManufacturer) {
[viewerData setViewerDeviceManufacturer:_customerViewerData.viewerDeviceManufacturer];
}
return viewerData;
}

Expand Down Expand Up @@ -678,4 +693,5 @@ + (void)dispatchError:(nonnull NSString *)code withMessage:(nonnull NSString *)m
if (!player) return;
[player dispatchError:code withMessage:message];
}

@end
23 changes: 23 additions & 0 deletions MUXSDKStats/MUXSDKStatsTests/MUXSDKStats+Internal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// MUXSDKStats+PropertyGetters.h
// MUXSDKStats
//
// Declares a project-level class extension that allows tests to get values under test out of the SDK
//
// Created by Emily Dixon on 10/17/22.
// Copyright © 2022 Mux, Inc. All rights reserved.
//

#ifndef MUXSDKStats_PropertyGetters_h
#define MUXSDKStats_PropertyGetters_h

#import "MUXSDKStats.h"

@interface MUXSDKStats()

// Expose buildViewerData for tests
+ (MUXSDKViewerData *)buildViewerData;

@end

#endif /* MUXSDKStats_PropertyGetters_h */
Loading

0 comments on commit 0a13634

Please sign in to comment.