Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add inline docs for both new and deprecated API #45

Merged
merged 6 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/MuxStatsGoogleIMAPlugin/MUXSDKIMAAdsListener.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@


- (instancetype)initWithPlayerBinding:(MUXSDKPlayerBinding *)binding
monitoringAdsLoader:(nullable IMAAdsLoader *)adsLoader {
monitoringAdsLoader:(nullable IMAAdsLoader *)adsLoader {
return [self initWithPlayerBinding:binding
options:MUXSDKIMAAdsListenerOptionsNone
monitoringAdsLoader:adsLoader];
}

- (instancetype)initWithPlayerBinding:(MUXSDKPlayerBinding *)binding
options:(MUXSDKIMAAdsListenerOptions)options
monitoringAdsLoader:(IMAAdsLoader *)adsLoader {
options:(MUXSDKIMAAdsListenerOptions)options
monitoringAdsLoader:(IMAAdsLoader *)adsLoader {
self = [super init];

if (self) {
Expand Down Expand Up @@ -73,7 +73,7 @@
// TODO: use newer IMA API here. universalAdIdValue
// is deprecated, but used for time being for parity
// with web&android
adData.adUniversalId = ad.universalAdIdValue;

Check warning on line 76 in Sources/MuxStatsGoogleIMAPlugin/MUXSDKIMAAdsListener.m

View workflow job for this annotation

GitHub Actions / Test the SDK with a Demo App

'universalAdIdValue' is deprecated: Use universalAdIDs instead. [-Wdeprecated-declarations]
event.adData = adData;
}
event.viewData = viewData;
Expand All @@ -89,7 +89,7 @@
// TODO: use newer IMA API here. universalAdIdValue
// is deprecated, but used for time being for parity
// with web&android
adData.adUniversalId = event.ad.universalAdIdValue;

Check warning on line 92 in Sources/MuxStatsGoogleIMAPlugin/MUXSDKIMAAdsListener.m

View workflow job for this annotation

GitHub Actions / Test the SDK with a Demo App

'universalAdIdValue' is deprecated: Use universalAdIDs instead. [-Wdeprecated-declarations]
}

return [self dispatchEvent:event.type
Expand Down
6 changes: 3 additions & 3 deletions Sources/MuxStatsGoogleIMAPlugin/MuxImaListener.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ @implementation MuxImaListener


- (instancetype)initWithPlayerBinding:(MUXSDKPlayerBinding *)binding
monitoringAdsLoader:(nullable IMAAdsLoader *)adsLoader {
monitoringAdsLoader:(nullable IMAAdsLoader *)adsLoader {
return [self initWithPlayerBinding:binding
options:MuxImaListenerOptionsNone
monitoringAdsLoader:adsLoader];
}

- (instancetype)initWithPlayerBinding:(MUXSDKPlayerBinding *)binding
options:(MuxImaListenerOptions)options
monitoringAdsLoader:(IMAAdsLoader *)adsLoader {
options:(MuxImaListenerOptions)options
monitoringAdsLoader:(IMAAdsLoader *)adsLoader {
self = [super init];

if (self) {
Expand Down
89 changes: 86 additions & 3 deletions Sources/MuxStatsGoogleIMAPlugin/include/MUXSDKIMAAdsListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,102 @@ typedef NS_OPTIONS(NSUInteger, MUXSDKIMAAdsListenerOptions) {
MUXSDKIMAAdsListenerOptionsPictureInPicture = 1 << 0,
};

/// Use `MUXSDKIMAAdsListener` to intercept `IMAAdsManager`
/// and `IMAAdsLoader` events from the IMA SDK on behalf of
/// your application.
@interface MUXSDKIMAAdsListener : NSObject<IMAAdsManagerDelegate, IMAAdsLoaderDelegate>

/// Your applications ads manager delegate, if configured
@property (nonatomic, weak, nullable) id<IMAAdsManagerDelegate> customerAdsManagerDelegate;

/// Your applications ads loader delegate, if configured
@property (nonatomic, weak, nullable) id<IMAAdsLoaderDelegate> customerAdsLoaderDelegate;

/// Initializes `MUXSDKIMAAdsListener`, automatically monitors
/// the IMA ad playback, and notifies the Mux Data SDK at key
/// points in the ad lifecycle.
///
/// After initialization, delegate calls from the provided
/// IMA ads loader will be intercepted and translated into
/// `MUXSDKPlaybackEvent`.
///
/// These playback events will then be forwarded on to the
/// supplied player binding and when reported to Mux will
/// appear on your Dashboard event timeline with other
/// playback events.
///
/// - Parameters:
/// - binding: player binding that will receive events
/// concerning ad playback
/// - adsLoader: ads loader whose delegate calls will be
/// monitored, make sure to set your own `IMAAdsLoaderDelegate`
/// **before** calling this initializer. Delegate calls
/// will then be automatically forwarded to your delegate.
- (instancetype)initWithPlayerBinding:(MUXSDKPlayerBinding *)binding
monitoringAdsLoader:(nullable IMAAdsLoader *)adsLoader;
monitoringAdsLoader:(nullable IMAAdsLoader *)adsLoader;

/// Initializes `MUXSDKIMAAdsListener`, automatically monitors
/// the IMA ad playback, and notifies the Mux Data SDK at key
/// points in the ad lifecycle.
///
/// After initialization, delegate calls from the provided
/// IMA ads loader will be intercepted and translated into
/// `MUXSDKPlaybackEvent`.
///
/// These playback events will then be forwarded on to the
/// supplied player binding and when reported to Mux will
/// appear on your Dashboard event timeline with other
/// playback events.
///
/// - Parameters:
/// - binding: player binding that will receive events
/// concerning ad playback
/// - options: options to indicate the starting state
/// of the player
/// - adsLoader: ads loader whose delegate calls will be
/// monitored, make sure to set your own `IMAAdsLoaderDelegate`
/// **before** calling this initializer. Delegate calls
/// will then be automatically forwarded to your delegate.
- (instancetype)initWithPlayerBinding:(MUXSDKPlayerBinding *)binding
options:(MUXSDKIMAAdsListenerOptions)options
monitoringAdsLoader:(nullable IMAAdsLoader *)adsLoader;
options:(MUXSDKIMAAdsListenerOptions)options
monitoringAdsLoader:(nullable IMAAdsLoader *)adsLoader;

/// Called when an `IMAAdsManager` is available to your
/// application. Like `IMAAdsLoader`, delegate
/// calls from the ads manager will be intercepted. Playback
/// events will be forwarded to the Mux Data player binding
/// configured during initialization
///
/// - Parameter adsManager: ads manager who delegate calls
/// will be monitored, make sure to set your own `IMAAdsManagerDelegate`
/// **before** calling this initializer. Delegate calls
/// will then be automatically forwarded to your delegate.
- (void)monitorAdsManager:(IMAAdsManager *)adsManager;

/// Signals if the monitored player is being displayed as
/// picture in picture during ad playback.
/// - Parameter isPictureInPicture: Pass ``YES`` to indicate
/// the player is current displayed using picture in picture.
/// Pass ``NO`` otherwise.
- (void)setPictureInPicture:(BOOL)isPictureInPicture;

/// Signals a client ad request made by your application.
///
/// Call as soon as possible after sending the request to
/// ensure accuracy.
///
/// - Parameter request: a client ad request your application
/// just made
- (void)clientAdRequest:(IMAAdsRequest *)request;

/// Signals a stream ad request has been made by your
/// application.
///
/// Call as soon as possible after sending the request to
/// ensure accuracy.
///
/// - Parameter request: a client ad request your application
/// just made
- (void)daiAdRequest:(IMAStreamRequest *)request;

@end
Expand Down
97 changes: 94 additions & 3 deletions Sources/MuxStatsGoogleIMAPlugin/include/MuxImaListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,111 @@ typedef NS_OPTIONS(NSUInteger, MuxImaListenerOptions) {
MuxImaListenerOptionsPictureInPicture = 1 << 0,
};

/// Use `MuxImaListener` to intercept `IMAAdsManager`
/// and `IMAAdsLoader` events from the IMA SDK on behalf of
/// your application.
///
/// **Note: this class is deprecated and will be removed in
/// a future SDK release. Please switch to using `MUXSDKIMAAdsListener`.**
NS_CLASS_DEPRECATED_IOS(2_0, 12_0, "Use MUXSDKIMAAdsListener instead.")
@interface MuxImaListener : NSObject<IMAAdsManagerDelegate, IMAAdsLoaderDelegate>

/// Your applications ads manager delegate, if configured
@property (nonatomic, weak, nullable) id<IMAAdsManagerDelegate> customerAdsManagerDelegate;

/// Your applications ads loader delegate, if configured
@property (nonatomic, weak, nullable) id<IMAAdsLoaderDelegate> customerAdsLoaderDelegate;

/// Initializes `MuxImaListener`, automatically monitors
/// the IMA ad playback, and notifies the Mux Data SDK at key
/// points in the ad lifecycle.
///
/// After initialization, delegate calls from the provided
/// IMA ads loader will be intercepted and translated into
/// `MUXSDKPlaybackEvent`.
///
/// These playback events will then be forwarded on to the
/// supplied player binding and when reported to Mux will
/// appear on your Dashboard event timeline with other
/// playback events.
///
/// - Parameters:
/// - binding: player binding that will receive events
/// concerning ad playback
/// - adsLoader: ads loader whose delegate calls will be
/// monitored, make sure to set your own `IMAAdsLoaderDelegate`
/// **before** calling this initializer. Delegate calls
/// will then be automatically forwarded to your delegate.
- (instancetype)initWithPlayerBinding:(MUXSDKPlayerBinding *)binding
monitoringAdsLoader:(nullable IMAAdsLoader *)adsLoader;
monitoringAdsLoader:(nullable IMAAdsLoader *)adsLoader;


/// Initializes `MuxImaListener`, automatically monitors
/// the IMA ad playback, and notifies the Mux Data SDK at key
/// points in the ad lifecycle.
///
/// After initialization delegate calls from the provided
/// IMA ads loader will be intercepted and translated into
/// `MUXSDKPlaybackEvent`.
///
/// These playback events will then be forwarded on to the
/// supplied player binding and when reported to Mux will
/// appear on your Dashboard event timeline with other
/// playback events.
///
/// - Parameters:
/// - binding: player binding that will receive events
/// concerning ad playback
/// - options: options to indicate the starting state
/// of the player
/// - adsLoader: ads loader whose delegate calls will be
/// monitored, make sure to set your own `IMAAdsLoaderDelegate`
/// **before** calling this initializer. Delegate calls
/// will then be automatically forwarded to your delegate.
- (instancetype)initWithPlayerBinding:(MUXSDKPlayerBinding *)binding
options:(MuxImaListenerOptions)options
monitoringAdsLoader:(nullable IMAAdsLoader *)adsLoader;
options:(MuxImaListenerOptions)options
monitoringAdsLoader:(nullable IMAAdsLoader *)adsLoader;


/// Called when an `IMAAdsManager` is available to your
/// application. Like `IMAAdsLoader`, delegate
/// calls from the ads manager will be intercepted. Playback
/// events will be forwarded to the Mux Data player binding
/// configured during initialization
///
/// - Parameter adsManager: ads manager who delegate calls
/// will be monitored, make sure to set your own `IMAAdsManagerDelegate`
/// **before** calling this initializer. Delegate calls
/// will then be automatically forwarded to your delegate.
- (void)monitorAdsManager:(IMAAdsManager *)adsManager;


/// Signals if the monitored player is being displayed as
/// picture in picture during ad playback.
/// - Parameter isPictureInPicture: Pass ``YES`` to indicate
/// the player is current displayed using picture in picture.
/// Pass ``NO`` otherwise.
- (void)setPictureInPicture:(BOOL)isPictureInPicture;


/// Signals a client ad request made by your application.
///
/// Call as soon as possible after sending the request to
/// ensure accuracy.
///
/// - Parameter request: a client ad request your application
/// just made
- (void)clientAdRequest:(IMAAdsRequest *)request;


/// Signals a stream ad request has been made by your
/// application.
///
/// Call as soon as possible after sending the request to
/// ensure accuracy.
///
/// - Parameter request: a client ad request your application
/// just made
- (void)daiAdRequest:(IMAStreamRequest *)request;

@end
Expand Down
Loading