Skip to content

Commit

Permalink
Releases/v3.4.0 (#210)
Browse files Browse the repository at this point in the history
* feat: monitoring for AVPlayer with fixed or zero player size (#208)

* feat: modifiable software name and software version (#209)

* fix: remove public accessor methods for player software name and version (#211)

* docs: add audio-only playback example
  • Loading branch information
andrewjl-mux authored Oct 12, 2023
1 parent 1049abf commit bbaae00
Show file tree
Hide file tree
Showing 36 changed files with 2,155 additions and 266 deletions.
3 changes: 2 additions & 1 deletion MUXSDKStats.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"3.3.0": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v3.3.0/MUXSDKStats.xcframework.zip",
"3.3.1": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v3.3.1/MUXSDKStats.xcframework.zip",
"3.3.2": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v3.3.2/MUXSDKStats.xcframework.zip",
"3.3.3": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v3.3.3/MUXSDKStats.xcframework.zip"
"3.3.3": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v3.3.3/MUXSDKStats.xcframework.zip",
"3.4.0": "https://github.com/muxinc/mux-stats-sdk-avplayer/releases/download/v3.4.0/MUXSDKStats.xcframework.zip"
}
8 changes: 4 additions & 4 deletions MUXSDKStats/MUXSDKStats.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.3.3;
MARKETING_VERSION = 3.4.0;
MODULEMAP_FILE = "$(SRCROOT)/MUXSDKStatsTv/module.modulemap";
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.tvos.MUXSDKStatsTv;
Expand Down Expand Up @@ -598,7 +598,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.3.3;
MARKETING_VERSION = 3.4.0;
MODULEMAP_FILE = "$(SRCROOT)/MUXSDKStatsTv/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.tvos.MUXSDKStatsTv;
PRODUCT_NAME = MUXSDKStats;
Expand Down Expand Up @@ -780,7 +780,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.3.3;
MARKETING_VERSION = 3.4.0;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.ios.MUXSDKStats;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -808,7 +808,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.3.3;
MARKETING_VERSION = 3.4.0;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.mux.stats.ios.MUXSDKStats;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
129 changes: 123 additions & 6 deletions MUXSDKStats/MUXSDKStats/MUXSDKPlayerBinding.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,24 @@ typedef NS_ENUM(NSUInteger, MUXSDKViewOrientation) {
MUXSDKViewOrientationLandscape
};

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"

@protocol MUXSDKPlayDispatchDelegate
- (void) playbackStartedForPlayer:(NSString *) name;
- (void) videoChangedForPlayer:(NSString *) name;
@end

#pragma clang diagnostic pop

@interface MUXSDKPlayerBinding : NSObject {

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"

@private
NSString *_name;
NSString *_software;
NSString *_softwareName;
AVPlayer *_player;
AVPlayerItem *_playerItem;
id _timeObserver;
Expand Down Expand Up @@ -76,11 +85,14 @@ typedef NS_ENUM(NSUInteger, MUXSDKViewOrientation) {
BOOL _playbackIsLivestream;
NSInteger _totalFrameDrops;
BOOL _totalFrameDropsHasChanged;
NSString *_softwareVersion;
}

@property (nonatomic, weak) id<MUXSDKPlayDispatchDelegate> playDispatchDelegate;

- (id)initWithName:(NSString *)name andSoftware:(NSString *)software;
- (id)initWithName:(NSString *)name
andSoftware:(NSString *)software;

- (void)attachAVPlayer:(AVPlayer *)player;
- (void)detachAVPlayer;
- (void)programChangedForPlayer;
Expand All @@ -104,24 +116,129 @@ typedef NS_ENUM(NSUInteger, MUXSDKViewOrientation) {
- (void)dispatchError:(NSString *)code withMessage:(NSString *)message;
- (void)didTriggerManualVideoChange;

@end
#pragma clang diagnostic pop

- (nonnull id)initWithPlayerName:(nonnull NSString *)playerName
softwareName:(nullable NSString *)softwareName;

- (nonnull id)initWithPlayerName:(nonnull NSString *)playerName
softwareName:(nullable NSString *)softwareName
softwareVersion:(nullable NSString *)softwareVersion;

@end

@interface MUXSDKAVPlayerViewControllerBinding : MUXSDKPlayerBinding {
@private
AVPlayerViewController *_viewController;
}

- (id)initWithName:(NSString *)name software:(NSString *)software andView:(AVPlayerViewController *)view;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"

/// Initializes a binding that listens for and dispatches player events
/// - Parameters:
/// - name: A name for this instance of the player
/// - software: The name of the underlying player software
/// - view: An AVPlayerViewController to monitor using this binding
- (id)initWithName:(NSString *)name
software:(NSString *)software
andView:(AVPlayerViewController *)view __attribute__((deprecated("Please migrate to initWithPlayerName:softwareName:playerViewController:")));

#pragma clang diagnostic pop


/// Initializes a binding that listens for and dispatches player events
/// - Parameters:
/// - playerName: A name for this instance of the player
/// - softwareName: The name of the underlying player software
/// - playerViewController: An AVPlayerViewController to monitor using this binding
- (nonnull id)initWithPlayerName:(nonnull NSString *)playerName
softwareName:(nullable NSString *)softwareName
playerViewController:(nonnull AVPlayerViewController *)playerViewController;


/// Initializes a binding that listens for and dispatches player events
/// - Parameters:
/// - playerName: A name for this instance of the player
/// - softwareName: The name of the underlying player software
/// - softwareVersion: The version of this player software
/// - playerViewController: An AVPlayerViewController to monitor using this binding
- (nonnull id)initWithPlayerName:(nonnull NSString *)playerName
softwareName:(nullable NSString *)softwareName
softwareVersion:(nullable NSString *)softwareVersion
playerViewController:(nonnull AVPlayerViewController *)playerViewController;

@end


@interface MUXSDKAVPlayerLayerBinding : MUXSDKPlayerBinding {
@private
AVPlayerLayer *_view;
}

- (id)initWithName:(NSString *)name software:(NSString *)software andView:(AVPlayerLayer *)view;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"


/// Initializes a binding that listens for and dispatches player events
/// - Parameters:
/// - name: A name for this instance of the player
/// - software: The name of the underlying player software
/// - view: An AVPlayerLayer to monitor
- (id)initWithName:(NSString *)name
software:(NSString *)software
andView:(AVPlayerLayer *)view __attribute__((deprecated("Please migrate to initWithPlayerName:softwareName:playerLayer:")));;

#pragma clang diagnostic pop


/// Initializes a binding that listens for and dispatches player events
/// - Parameters:
/// - playerName: A name for this instance of the player
/// - softwareName: The name of the underlying player software
/// - playerLayer: An AVPlayerLayer to monitor
- (nonnull id)initWithPlayerName:(nonnull NSString *)playerName
softwareName:(nullable NSString *)softwareName
playerLayer:(nonnull AVPlayerLayer *)playerLayer;


/// Initializes a binding that listens for and dispatches player events
/// - Parameters:
/// - playerName: A name for this instance of the player
/// - softwareName: The name of the underlying player software
/// - softwareVersion: The version of this player software
/// - playerLayer: An AVPlayerLayer to monitor
- (nonnull id)initWithPlayerName:(nonnull NSString *)playerName
softwareName:(nullable NSString *)softwareName
softwareVersion:(nullable NSString *)softwareVersion
playerLayer:(nonnull AVPlayerLayer *)playerLayer;

@end

@interface MUXSDKAVPlayerBinding : MUXSDKPlayerBinding {
@private
CGSize _fixedPlayerSize;
}


/// Initializes a binding that listens for and dispatches player events
/// - Parameters:
/// - playerName: A name for this instance of the player
/// - softwareName: The name of the underlying player software
/// - fixedPlayerSize: A fixed size of your player that will not change, inclusive of any letter boxed or pillar boxed areas. If monitoring audio only media, pass in CGSizeMake(0.0, 0.0)
- (nonnull id)initWithPlayerName:(nonnull NSString *)playerName
softwareName:(nullable NSString *)softwareName
fixedPlayerSize:(CGSize)fixedPlayerSize;


/// Initializes a binding that listens for and dispatches player events
/// - Parameters:
/// - playerName: A name for this instance of the player
/// - softwareName: The name of the underlying player software
/// - softwareVersion: The version of this player software
/// - fixedPlayerSize: A fixed size of your player that will not change, inclusive of any letter boxed or pillar boxed areas. If monitoring audio only media, pass in CGSizeMake(0.0, 0.0)
- (nonnull id)initWithPlayerName:(nonnull NSString *)playerName
softwareName:(nullable NSString *)softwareName
softwareVersion:(nullable NSString *)softwareVersion
fixedPlayerSize:(CGSize)fixedPlayerSize;

@end
Loading

0 comments on commit bbaae00

Please sign in to comment.