Skip to content

Commit

Permalink
Releases/v3.6.2 (#240)
Browse files Browse the repository at this point in the history
* fix: avoid setting unused AVPlayer specific error dimension

---------
Co-authored-by: Tomislav Kordic <[email protected]>
  • Loading branch information
andrewjl-mux authored May 3, 2024
1 parent ddac23a commit 4bda9c2
Show file tree
Hide file tree
Showing 55 changed files with 272 additions and 471 deletions.
34 changes: 34 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
agents:
queue: "macOS-Monterey-12-4"

steps:
- command: "./scripts/run-baseline-unit-test-pass.sh"
label: ":xcode_simulator: Baseline Unit Test Pass"
- wait
- command: ".buildkite/scripts/dynamic-xcframework.sh"
label: ":xcode: Create Dynamic XCFramework"
artifact_paths:
- "./XCFramework/MUXSDKStats.xcframework.zip"
- wait
- command: "buildkite-agent artifact download XCFramework/MUXSDKStats.xcframework.zip XCFramework && ./scripts/run-tests-swift-package-manager-ventura.sh"
label: ":swift: Test Swift Package Manager Example"
retry:
automatic: true
- wait
- command: ".buildkite/scripts/static-xcframework.sh"
label: ":xcode: Create Static XCFramework"
artifact_paths:
- "./XCFramework/MUXSDKStats-static.xcframework.zip"
- wait
- command: "buildkite-agent artifact download XCFramework/MUXSDKStats.xcframework.zip XCFramework && ./scripts/run-tests-cocoapods-ventura.sh"
label: ":cocoapods: Test Cocoapods Example"
retry:
automatic: true
- wait
- command: "./scripts/version-check.sh Mux-Stats-AVPlayer.podspec MUXSDKStats.json"
label: ":clipboard: Validate Version Metadata"
branches: "releases/*"
- command: "./scripts/validate-podspec.sh"
label: ":cocoapods: Validate Podspec"
branches: "releases/*"

6 changes: 6 additions & 0 deletions .buildkite/scripts/dynamic-xcframework.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail

./scripts/create-dynamic-xcframework.sh
cd XCFramework
zip -ry MUXSDKStats.xcframework.zip MUXSDKStats.xcframework
6 changes: 6 additions & 0 deletions .buildkite/scripts/static-xcframework.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail

./scripts/create-static-xcframework.sh
cd XCFramework
zip -ry MUXSDKStats-static.xcframework.zip MUXSDKStats.xcframework
78 changes: 0 additions & 78 deletions .github/workflows/build-and-test.yml

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/validate-release.yml

This file was deleted.

3 changes: 2 additions & 1 deletion MUXSDKStats.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"3.5.0": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v3.5.0/MUXSDKStats.xcframework.zip",
"3.5.1": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v3.5.1/MUXSDKStats.xcframework.zip",
"3.6.0": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v3.6.0/MUXSDKStats.xcframework.zip",
"3.6.1": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v3.6.1/MUXSDKStats.xcframework.zip"
"3.6.1": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v3.6.1/MUXSDKStats.xcframework.zip",
"3.6.2": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v3.6.2/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 @@ -773,7 +773,7 @@
"@loader_path/Frameworks",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 3.6.1;
MARKETING_VERSION = 3.6.2;
MODULEMAP_FILE = "$(SRCROOT)/MUXSDKStatsVision/module.modulemap";
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
Expand Down Expand Up @@ -821,7 +821,7 @@
"@loader_path/Frameworks",
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 3.6.1;
MARKETING_VERSION = 3.6.2;
MODULEMAP_FILE = "$(SRCROOT)/MUXSDKStatsVision/module.modulemap";
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
Expand Down Expand Up @@ -917,7 +917,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.6.1;
MARKETING_VERSION = 3.6.2;
MODULEMAP_FILE = "$(SRCROOT)/MUXSDKStatsTv/module.modulemap";
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.tvos.MUXSDKStatsTv;
Expand Down Expand Up @@ -951,7 +951,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.6.1;
MARKETING_VERSION = 3.6.2;
MODULEMAP_FILE = "$(SRCROOT)/MUXSDKStatsTv/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.tvos.MUXSDKStatsTv;
PRODUCT_NAME = MUXSDKStats;
Expand Down Expand Up @@ -1134,7 +1134,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.6.1;
MARKETING_VERSION = 3.6.2;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.ios.MUXSDKStats;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1168,7 +1168,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.6.1;
MARKETING_VERSION = 3.6.2;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.ios.MUXSDKStats;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
2 changes: 2 additions & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKCustomerCustomDataStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#import <Foundation/Foundation.h>
#if TVOS
#import <MuxCore/MuxCoreTv.h>
#elif TARGET_OS_VISION
#import <MuxCore/MuxCoreVision.h>
#else
#import <MuxCore/MuxCore.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKCustomerPlayerDataStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#import <Foundation/Foundation.h>
#if TVOS
#import <MuxCore/MuxCoreTv.h>
#elif TARGET_OS_VISION
#import <MuxCore/MuxCoreVision.h>
#else
#import <MuxCore/MuxCore.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKCustomerVideoDataStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#import <Foundation/Foundation.h>
#if TVOS
#import <MuxCore/MuxCoreTv.h>
#elif TARGET_OS_VISION
#import <MuxCore/MuxCoreVision.h>
#else
#import <MuxCore/MuxCore.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKCustomerViewDataStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#import <Foundation/Foundation.h>
#if TVOS
#import <MuxCore/MuxCoreTv.h>
#elif TARGET_OS_VISION
#import <MuxCore/MuxCoreVision.h>
#else
#import <MuxCore/MuxCore.h>
#endif
Expand Down
63 changes: 16 additions & 47 deletions MUXSDKStats/MUXSDKStats/MUXSDKPlayerBinding.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

// SDK constants.
NSString *const MUXSDKPluginName = @"apple-mux";
NSString *const MUXSDKPluginVersion = @"3.6.1";
NSString *const MUXSDKPluginVersion = @"3.6.2";
NSString *const MUXSessionDataPrefix = @"io.litix.data.";

// Min number of seconds between timeupdate events. (100ms)
Expand Down Expand Up @@ -649,30 +649,23 @@ - (MUXSDKPlayerData *)getPlayerData {
#endif

// Derived from the player.
NSMutableArray *errors = [NSMutableArray new];
NSString *defaultMsg = nil;
NSInteger errorCode = 0;
if (_player.error) {
[errors addObject:[self buildError:@"p"
domain:_player.error.domain
code:_player.error.code
message:_player.error.localizedDescription]];
defaultMsg = _player.error.localizedDescription;
errorCode = _player.error.code;
NSInteger errorCode = _player.error.code;
if (errorCode != 0 && errorCode != NSNotFound) {
[playerData setPlayerErrorCode:[NSString stringWithFormat:@"%ld", (long)errorCode]];
}
NSString *errorLocalizedDescription = _player.error.localizedDescription;
if (errorLocalizedDescription != nil) {
[playerData setPlayerErrorMessage:errorLocalizedDescription];
}
} else if (_playerItem && _playerItem.error) {
[errors addObject:[self buildError:@"i"
domain:_playerItem.error.domain
code:_playerItem.error.code
message:_playerItem.error.localizedDescription]];
defaultMsg = _playerItem.error.localizedDescription;
errorCode = _playerItem.error.code;
// Append the full error log.
for (AVPlayerItemErrorLogEvent *event in _playerItem.errorLog.events) {
[errors addObject:[self buildError:@"l"
domain:event.errorDomain
code:event.errorStatusCode
message:(event.errorComment ? event.errorComment : @"")]];

NSInteger errorCode = _playerItem.error.code;
if (errorCode != 0 && errorCode != NSNotFound) {
[playerData setPlayerErrorCode:[NSString stringWithFormat:@"%ld", (long)errorCode]];
}
NSString *errorLocalizedDescription = _playerItem.error.localizedDescription;
if (errorLocalizedDescription != nil) {
[playerData setPlayerErrorMessage:errorLocalizedDescription];
}
} else {
// Not sure if both checks are necessary here as when rate is 0 we expect to be paused and vice versa.
Expand All @@ -686,21 +679,6 @@ - (MUXSDKPlayerData *)getPlayerData {
[self setPlayerPlayheadTime:ms onPlayerData:playerData];
}
}

if ([errors count] > 0 && defaultMsg) {
// Hard coded default value for now. Error codes on iOS have no meaning for now.
// We'll reclassify/recode errors on the backend as we learn more.
[playerData setPlayerErrorCode:[NSString stringWithFormat:@"%ld", (long)errorCode]];
[playerData setPlayerErrorMessage:defaultMsg];
NSError *error = nil;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:errors
options:0
error:&error];
if (!error) {
[playerData setPlayeriOSErrorData:[[NSString alloc] initWithData:jsonData
encoding:NSUTF8StringEncoding]];
}
}

// Only report program time metrics if this is a live stream
if (_playbackIsLivestream) {
Expand Down Expand Up @@ -742,15 +720,6 @@ - (void) setPlayerPlayheadTime:(float) playheadTimeMs onPlayerData:(MUXSDKPlayer
[playerData setPlayerPlayheadTime:[NSNumber numberWithLongLong:[timeMs longLongValue]]];
}

- (NSDictionary *)buildError:(NSString *)level domain:(NSString *)domain code:(NSInteger)code message:(NSString *)message {
return @{
@"l": level,
@"d": domain,
@"c": [NSString stringWithFormat:@"%ld", (long)code],
@"m": (message == nil ? @"n/a" : message),
};
}

- (BOOL)isPlayerOK {
if (!_player) {
NSLog(@"MUXSDK-ERROR - Mux failed to find the AVPlayer for player name: %@", _name);
Expand Down
2 changes: 2 additions & 0 deletions MUXSDKStats/MUXSDKStats/MUXSDKPlayerBindingManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#import <Foundation/Foundation.h>
#if TVOS
#import <MuxCore/MuxCoreTv.h>
#elif TARGET_OS_VISION
#import <MuxCore/MuxCoreVision.h>
#else
#import <MuxCore/MuxCore.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion 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 = '3.6.1'
s.version = '3.6.2'
s.source = { :git => 'https://github.com/muxinc/mux-stats-sdk-avplayer.git',
:tag => "v#{s.version}" }

Expand Down
Loading

0 comments on commit 4bda9c2

Please sign in to comment.