Skip to content

Commit

Permalink
build: add xcconfig, to simplify version updates (#250)
Browse files Browse the repository at this point in the history
* fix: tear down view on hard application termination

dispatch a viewend automatically and tear down player
monitoring when the application shuts down

* build: add xcconfig, to simplify version updates

* build: use per target xcconfig to match core

* ci: consistent logs

* ci: make these scripts consistent

* fix indentation

* build: add comments on config names

* ci: skip lengthy app tests when not on release branch
  • Loading branch information
andrewjl-mux committed Oct 18, 2024
1 parent 67f9c59 commit b79a51e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
18 changes: 18 additions & 0 deletions MUXSDKStats/MUXSDKStats.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
02EB9E2E23E896790007E1CD /* MUXSDKCustomerVideoDataStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 02EB9E2C23E896790007E1CD /* MUXSDKCustomerVideoDataStore.m */; };
02EB9E2F23E896A90007E1CD /* MUXSDKCustomerVideoDataStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 02EB9E2B23E896790007E1CD /* MUXSDKCustomerVideoDataStore.h */; };
02EB9E3023E896F20007E1CD /* MUXSDKCustomerVideoDataStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 02EB9E2C23E896790007E1CD /* MUXSDKCustomerVideoDataStore.m */; };
1915A2102CC064B80094AA27 /* MUXSDKStats.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 1915A20F2CC064B80094AA27 /* MUXSDKStats.xcconfig */; };
1915A2112CC064B80094AA27 /* MUXSDKStats.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 1915A20F2CC064B80094AA27 /* MUXSDKStats.xcconfig */; };
1915A2122CC064B80094AA27 /* MUXSDKStats.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 1915A20F2CC064B80094AA27 /* MUXSDKStats.xcconfig */; };
1915A2262CC1C3E70094AA27 /* MUXSDKStatsBase.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 1915A2252CC1C3E70094AA27 /* MUXSDKStatsBase.xcconfig */; };
1915A2272CC1C3E70094AA27 /* MUXSDKStatsBase.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 1915A2252CC1C3E70094AA27 /* MUXSDKStatsBase.xcconfig */; };
1915A2282CC1C3E70094AA27 /* MUXSDKStatsBase.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 1915A2252CC1C3E70094AA27 /* MUXSDKStatsBase.xcconfig */; };
1915A22A2CC1C4240094AA27 /* MUXSDKStatsTv.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 1915A2292CC1C4240094AA27 /* MUXSDKStatsTv.xcconfig */; };
1915A22B2CC1C4240094AA27 /* MUXSDKStatsTv.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 1915A2292CC1C4240094AA27 /* MUXSDKStatsTv.xcconfig */; };
1915A22C2CC1C4240094AA27 /* MUXSDKStatsTv.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 1915A2292CC1C4240094AA27 /* MUXSDKStatsTv.xcconfig */; };
1917D7BC2AB97FBC009654E8 /* MUXSDKStatsTvTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1917D7BB2AB97FBC009654E8 /* MUXSDKStatsTvTests.m */; };
1917D7C32AB97FC5009654E8 /* MUXSDKStats.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F41E09041DDA8E530028A296 /* MUXSDKStats.framework */; };
195800E32B51BD43008BE2EB /* MUXSDKStatsVision.h in Headers */ = {isa = PBXBuildFile; fileRef = 195800E22B51BD43008BE2EB /* MUXSDKStatsVision.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -574,6 +583,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1915A2122CC064B80094AA27 /* MUXSDKStats.xcconfig in Resources */,
1915A2272CC1C3E70094AA27 /* MUXSDKStatsBase.xcconfig in Resources */,
1915A22B2CC1C4240094AA27 /* MUXSDKStatsTv.xcconfig in Resources */,
19DB618B2BD1E0210048424F /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -589,6 +601,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1915A2112CC064B80094AA27 /* MUXSDKStats.xcconfig in Resources */,
1915A2262CC1C3E70094AA27 /* MUXSDKStatsBase.xcconfig in Resources */,
1915A22A2CC1C4240094AA27 /* MUXSDKStatsTv.xcconfig in Resources */,
19DB618A2BD1E0200048424F /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -597,6 +612,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1915A2102CC064B80094AA27 /* MUXSDKStats.xcconfig in Resources */,
1915A2282CC1C3E70094AA27 /* MUXSDKStatsBase.xcconfig in Resources */,
1915A22C2CC1C4240094AA27 /* MUXSDKStatsTv.xcconfig in Resources */,
19DB61892BD1E01F0048424F /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
16 changes: 13 additions & 3 deletions MUXSDKStats/MUXSDKStats/MUXSDKPlayerBinding.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ - (void)attachAVPlayer:(AVPlayer *)player {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleRenditionChange:) name:RenditionChangeNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAVPlayerError:) name:AVPlayerItemNewErrorLogEntryNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleConnectionTypeDetected:) name:@"com.mux.connection-type-detected" object:nil];


[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleApplicationWillTerminate:)
name:UIApplicationWillTerminateNotification
object:nil];
//
// dylanjhaveri
// See MUXSDKConnection.m for the tvos shortcoming
Expand Down Expand Up @@ -186,6 +190,13 @@ - (void)handleConnectionTypeDetected:(NSNotification *)notif {
});
}

- (void)handleApplicationWillTerminate:(NSNotification *)notification {
[self dispatchViewEnd];
[self stopMonitoringAVPlayerItem];

[MUXSDKCore destroyPlayer:self.name];
}

# pragma mark AVPlayerItemAccessLog

- (void)handleAVPlayerAccess:(NSNotification *)notif {
Expand Down Expand Up @@ -391,7 +402,7 @@ - (void)monitorAVPlayerItem {
if (_didTriggerManualVideoChange) {
_didTriggerManualVideoChange = false;
}
// NSLog(@"%s: Dispatching View End", __PRETTY_FUNCTION__);

[self dispatchViewEnd];
[self stopMonitoringAVPlayerItem];

Expand Down Expand Up @@ -471,7 +482,6 @@ - (void)stopMonitoringAVPlayerItem {
[self safelyRemovePlayerItemObserverForKeyPath:@"playbackBufferEmpty"];
_playerItem = nil;
if (!_isAdPlaying) {
// NSLog(@"%s: MUXSDKCore destroyPlayer", __PRETTY_FUNCTION__);
[MUXSDKCore destroyPlayer: _name];
}
}
Expand Down

0 comments on commit b79a51e

Please sign in to comment.