diff --git a/Sources/MUXSDKStatsObjc/MUXSDKStats.m b/Sources/MUXSDKStatsObjc/MUXSDKStats.m index 1a62234b..ead59841 100644 --- a/Sources/MUXSDKStatsObjc/MUXSDKStats.m +++ b/Sources/MUXSDKStatsObjc/MUXSDKStats.m @@ -22,11 +22,11 @@ + (nullable MUXSDKPlayerBinding *)monitorAVPlayerViewController:(nonnull AVPlaye automaticErrorTracking:(BOOL)automaticErrorTracking beaconCollectionDomain:(nullable NSString *)collectionDomain { - return [[MUXSDKMonitor sharedMonitor] startMonitoringPlayerViewController:player - withPlayerName:name - customerData:customerData - automaticErrorTracking:automaticErrorTracking - beaconCollectionDomain:collectionDomain]; + return [[MUXSDKMonitor shared] startMonitoringPlayerViewController:player + withPlayerName:name + customerData:customerData + automaticErrorTracking:automaticErrorTracking + beaconCollectionDomain:collectionDomain]; } + (nullable MUXSDKPlayerBinding *)monitorAVPlayerViewController:(nonnull AVPlayerViewController *)player @@ -38,7 +38,7 @@ + (nullable MUXSDKPlayerBinding *)monitorAVPlayerViewController:(nonnull AVPlaye customerData:customerData automaticErrorTracking:automaticErrorTracking beaconCollectionDomain:nil]; - + } + (nullable MUXSDKPlayerBinding *)monitorAVPlayerViewController:(nonnull AVPlayerViewController *)player @@ -52,8 +52,8 @@ + (nullable MUXSDKPlayerBinding *)monitorAVPlayerViewController:(nonnull AVPlaye } + (void)updateAVPlayerViewController:(nonnull AVPlayerViewController *)player withPlayerName:(nonnull NSString *)name { - [[MUXSDKMonitor sharedMonitor] updatePlayerViewController:player - withPlayerName:name]; + [[MUXSDKMonitor shared] updatePlayerViewController:player + withPlayerName:name]; } #pragma mark Monitor AVPlayerLayer @@ -63,29 +63,29 @@ + (nullable MUXSDKPlayerBinding *)monitorAVPlayerLayer:(nonnull AVPlayerLayer *) customerData:(nonnull MUXSDKCustomerData *)customerData automaticErrorTracking:(BOOL)automaticErrorTracking beaconCollectionDomain:(nullable NSString *)collectionDomain { - return [[MUXSDKMonitor sharedMonitor] startMonitoringPlayerLayer:player - withPlayerName:name - customerData:customerData - automaticErrorTracking:automaticErrorTracking - beaconCollectionDomain:collectionDomain]; + return [[MUXSDKMonitor shared] startMonitoringPlayerLayer:player + withPlayerName:name + customerData:customerData + automaticErrorTracking:automaticErrorTracking + beaconCollectionDomain:collectionDomain]; } + (nullable MUXSDKPlayerBinding *)monitorAVPlayerLayer:(nonnull AVPlayerLayer *)player withPlayerName:(nonnull NSString *)name customerData:(nonnull MUXSDKCustomerData *)customerData automaticErrorTracking:(BOOL)automaticErrorTracking { - + return [self monitorAVPlayerLayer:player withPlayerName:name customerData:customerData automaticErrorTracking:automaticErrorTracking - beaconCollectionDomain:nil]; + beaconCollectionDomain:nil]; } + (nullable MUXSDKPlayerBinding *)monitorAVPlayerLayer:(nonnull AVPlayerLayer *)player withPlayerName:(nonnull NSString *)name customerData:(nonnull MUXSDKCustomerData *)customerData { - + return [self monitorAVPlayerLayer:player withPlayerName:name customerData:customerData @@ -93,8 +93,8 @@ + (nullable MUXSDKPlayerBinding *)monitorAVPlayerLayer:(nonnull AVPlayerLayer *) } + (void)updateAVPlayerLayer:(AVPlayerLayer *)player withPlayerName:(NSString *)name { - [[MUXSDKMonitor sharedMonitor] updatePlayerLayer:player - withPlayerName:name]; + [[MUXSDKMonitor shared] updatePlayerLayer:player + withPlayerName:name]; } #pragma mark Monitor AVPlayer @@ -130,51 +130,51 @@ + (nullable MUXSDKPlayerBinding *)monitorAVPlayer:(nonnull AVPlayer *)player customerData:(nonnull MUXSDKCustomerData *)customerData automaticErrorTracking:(BOOL)automaticErrorTracking beaconCollectionDomain:(nullable NSString *)collectionDomain { - return [[MUXSDKMonitor sharedMonitor] startMonitoringPlayer:player - withPlayerName:name - fixedPlayerSize:fixedPlayerSize - customerData:customerData - automaticErrorTracking:automaticErrorTracking - beaconCollectionDomain:collectionDomain]; + return [[MUXSDKMonitor shared] startMonitoringPlayer:player + withPlayerName:name + fixedPlayerSize:fixedPlayerSize + customerData:customerData + automaticErrorTracking:automaticErrorTracking + beaconCollectionDomain:collectionDomain]; } + (void)updateAVPlayer:(AVPlayer *)player withPlayerName:(NSString *)name fixedPlayerSize:(CGSize)fixedPlayerSize { - [[MUXSDKMonitor sharedMonitor] updatePlayer:player - withPlayerName:name - fixedPlayerSize:fixedPlayerSize]; + [[MUXSDKMonitor shared] updatePlayer:player + withPlayerName:name + fixedPlayerSize:fixedPlayerSize]; } #pragma mark Destroy Player + (void)destroyPlayer:(NSString *)name { - [[MUXSDKMonitor sharedMonitor] stopMonitoringWithPlayerName:name]; + [[MUXSDKMonitor shared] stopMonitoringWithPlayerName:name]; } #pragma mark Video Change + (void)videoChangeForPlayer:(nonnull NSString *)name withCustomerData:(nullable MUXSDKCustomerData *)customerData { - - [[MUXSDKMonitor sharedMonitor] signalVideoChangeForPlayerName:name - withUpdatedCustomerData:customerData]; + + [[MUXSDKMonitor shared] signalVideoChangeForPlayerName:name + withUpdatedCustomerData:customerData]; } #pragma mark Program Change + (void)programChangeForPlayer:(nonnull NSString *)name withCustomerData:(nullable MUXSDKCustomerData *)customerData { - [[MUXSDKMonitor sharedMonitor] signalProgramChangeForPlayerName:name - withUpdatedCustomerData:customerData]; + [[MUXSDKMonitor shared] signalProgramChangeForPlayerName:name + withUpdatedCustomerData:customerData]; } + (void)setAutomaticVideoChange:(NSString *)name enabled:(Boolean)enabled { if (enabled) { - [[MUXSDKMonitor sharedMonitor] enableAutomaticVideoChangeDetectionForPlayerName:name]; + [[MUXSDKMonitor shared] enableAutomaticVideoChangeDetectionForPlayerName:name]; } else { - [[MUXSDKMonitor sharedMonitor] disableAutomaticVideoChangeDetectionForPlayerName:name]; + [[MUXSDKMonitor shared] disableAutomaticVideoChangeDetectionForPlayerName:name]; } } @@ -182,16 +182,16 @@ + (void)setAutomaticVideoChange:(NSString *)name + (void)setCustomerData:(nullable MUXSDKCustomerData *)customerData forPlayer:(nonnull NSString *)name { - [[MUXSDKMonitor sharedMonitor] updatePlayerName:name - withCustomerData:customerData]; + [[MUXSDKMonitor shared] updatePlayerName:name + withCustomerData:customerData]; } #pragma mark Orientation Change + (void)orientationChangeForPlayer:(nonnull NSString *)name withOrientation:(MUXSDKViewOrientation)orientation { - [[MUXSDKMonitor sharedMonitor] signalOrientationChangeForPlayerName:name - updatedOrientation:orientation]; + [[MUXSDKMonitor shared] signalOrientationChangeForPlayerName:name + updatedOrientation:orientation]; } #pragma mark Error @@ -199,9 +199,9 @@ + (void)orientationChangeForPlayer:(nonnull NSString *)name + (void)dispatchError:(nonnull NSString *)code withMessage:(nonnull NSString *)message forPlayer:(nonnull NSString *)name { - [[MUXSDKMonitor sharedMonitor] dispatchErrorForPlayerName:name - errorCode:code - errorMessage:message]; + [[MUXSDKMonitor shared] dispatchErrorForPlayerName:name + errorCode:code + errorMessage:message]; } @end diff --git a/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/AudioOnlyPlaybackExampleViewController.swift b/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/AudioOnlyPlaybackExampleViewController.swift index 3fe2ffa5..e8c165f2 100644 --- a/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/AudioOnlyPlaybackExampleViewController.swift +++ b/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/AudioOnlyPlaybackExampleViewController.swift @@ -36,7 +36,7 @@ class AudioOnlyPlaybackExampleViewController: UIViewController { viewData: nil )! - MUXSDKMonitor.shared().startMonitoring( + MUXSDKMonitor.shared.startMonitoring( player: player, playerName: playerName, fixedPlayerSize: CGSize.zero, @@ -50,7 +50,7 @@ class AudioOnlyPlaybackExampleViewController: UIViewController { } override func viewWillDisappear(_ animated: Bool) { - MUXSDKMonitor.shared().stopMonitoring( + MUXSDKMonitor.shared.stopMonitoring( playerName: playerName ) player.pause() diff --git a/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/BasicPlaybackExampleViewController.swift b/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/BasicPlaybackExampleViewController.swift index bda7c4d7..7fb94b4e 100644 --- a/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/BasicPlaybackExampleViewController.swift +++ b/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/BasicPlaybackExampleViewController.swift @@ -45,7 +45,7 @@ class BasicPlaybackExampleViewController: UIViewController { displayPlayerViewController() - MUXSDKMonitor.shared().startMonitoring( + MUXSDKMonitor.shared.startMonitoring( playerViewController: playerViewController, playerName: playerName, customerData: customerData! @@ -98,7 +98,7 @@ class BasicPlaybackExampleViewController: UIViewController { if !playerViewController.allowsPictureInPicturePlayback { playerViewController.player?.pause() - MUXSDKMonitor.shared().stopMonitoring( + MUXSDKMonitor.shared.stopMonitoring( playerName: playerName ) } diff --git a/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/MultiplePlayerItemPlaybackExampleViewController.swift b/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/MultiplePlayerItemPlaybackExampleViewController.swift index 7a0eac8e..d6da63ae 100644 --- a/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/MultiplePlayerItemPlaybackExampleViewController.swift +++ b/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/MultiplePlayerItemPlaybackExampleViewController.swift @@ -59,7 +59,7 @@ class VideoChangeExampleViewController: MultiplePlayerItemPlaybackExampleViewCon customerData.customerVideoData = videoData customerData.customData = customData - MUXSDKMonitor.shared().signalVideoChange( + MUXSDKMonitor.shared.signalVideoChange( playerName: playerName, updatedCustomerData: customerData ) @@ -124,7 +124,7 @@ class MultiplePlayerItemPlaybackExampleViewController: UIViewController { viewData: nil ) - MUXSDKMonitor.shared().startMonitoring( + MUXSDKMonitor.shared.startMonitoring( playerViewController: playerViewController, playerName: playerName, customerData: customerData! @@ -138,7 +138,7 @@ class MultiplePlayerItemPlaybackExampleViewController: UIViewController { } override func viewWillDisappear(_ animated: Bool) { - MUXSDKMonitor.shared().stopMonitoring( + MUXSDKMonitor.shared.stopMonitoring( playerName: playerName ) @@ -183,7 +183,7 @@ class MultiplePlayerItemPlaybackExampleViewController: UIViewController { let customerData = MUXSDKCustomerData() customerData.customerVideoData = videoData - MUXSDKMonitor.shared().signalVideoChange( + MUXSDKMonitor.shared.signalVideoChange( playerName: playerName, updatedCustomerData: customerData ) diff --git a/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/PlayerLayerExampleViewController.swift b/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/PlayerLayerExampleViewController.swift index 771de8f5..df19544f 100644 --- a/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/PlayerLayerExampleViewController.swift +++ b/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/PlayerLayerExampleViewController.swift @@ -84,7 +84,7 @@ class PlayerLayerExampleViewController: UIViewController { return } - MUXSDKMonitor.shared().startMonitoring( + MUXSDKMonitor.shared.startMonitoring( playerLayer: playerLayer, playerName: playerName, customerData: customerData @@ -97,7 +97,7 @@ class PlayerLayerExampleViewController: UIViewController { } override func viewWillDisappear(_ animated: Bool) { - MUXSDKMonitor.shared().stopMonitoring( + MUXSDKMonitor.shared.stopMonitoring( playerName: playerName ) playerView.player?.pause() diff --git a/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/PlayerLayerScalingExampleViewController.swift b/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/PlayerLayerScalingExampleViewController.swift index 8134f1a3..9af85976 100644 --- a/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/PlayerLayerScalingExampleViewController.swift +++ b/apps/MUXSDKStatsExampleSPM/MUXSDKStatsExampleSPM/PlayerLayerScalingExampleViewController.swift @@ -67,7 +67,7 @@ class PlayerLayerScalingExampleViewController: UIViewController { return } - MUXSDKMonitor.shared().startMonitoring( + MUXSDKMonitor.shared.startMonitoring( playerLayer: playerLayer, playerName: playerName, customerData: customerData @@ -80,7 +80,7 @@ class PlayerLayerScalingExampleViewController: UIViewController { } override func viewWillDisappear(_ animated: Bool) { - MUXSDKMonitor.shared().stopMonitoring( + MUXSDKMonitor.shared.stopMonitoring( playerName: playerName ) playerView.player?.pause()