Skip to content

Commit

Permalink
expose a consistent API here
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjl-mux committed Sep 30, 2024
1 parent 353e521 commit b32a846
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
14 changes: 10 additions & 4 deletions Sources/MuxStatsGoogleIMAPlugin/MuxImaListener.m
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ - (void)dispatchError:(NSString *)message {
[_playerBinding dispatchAdEvent:playbackEvent];
}

- (void)onContentPauseOrResume:(bool)isPause {
- (void)dispatchPauseOrResume:(BOOL)isPause {
MUXSDKAdEvent *playbackEvent;
if (isPause) {
if (_isPictureInPicture) {
Expand Down Expand Up @@ -202,6 +202,10 @@ - (void)onContentPauseOrResume:(bool)isPause {
}
}

- (void)onContentPauseOrResume:(BOOL)isPause {
[self dispatchPauseOrResume:isPause]
}

- (void)setupAdViewDataAndDispatchEvent:(MUXSDKAdEvent *) event {
[self setupAdViewData:event withAd:nil];
[_playerBinding dispatchAdEvent:event];
Expand All @@ -223,17 +227,19 @@ - (void)daiAdRequest:(IMAStreamRequest *)request {

- (void)dispatchAdRequestWithoutMetadata {
MUXSDKAdEvent* playbackEvent = [[MUXSDKAdRequestEvent alloc] init];
[self setupAdViewDataAndDispatchEvent: playbackEvent];
[self setupAdViewData:playbackEvent withAd:nil];
[[self playerBinding] dispatchAdEvent:playbackEvent];
}

- (void)dispatchAdRequestForAdTag:(NSString *_Nullable)adTagUrl {
MUXSDKAdEvent* playbackEvent = [[MUXSDKAdRequestEvent alloc] init];
MUXSDKAdData* adData = [[MUXSDKAdData alloc] init];
if(adTagUrl) {
if (adTagUrl) {
adData.adTagUrl = adTagUrl;
}

[self setupAdViewDataAndDispatchEvent: playbackEvent];
[self setupAdViewData:playbackEvent withAd:nil];
[[self playerBinding] dispatchAdEvent:playbackEvent];
}

- (void)setPictureInPicture:(BOOL)isPictureInPicture {
Expand Down
3 changes: 2 additions & 1 deletion Sources/MuxStatsGoogleIMAPlugin/include/MuxImaListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ typedef NS_OPTIONS(NSUInteger, MuxImaListenerOptions) {
withAdData:(nullable MUXSDKAdData *)adData
withIMAAdData:(nullable NSDictionary *)imaAdData;
- (void)dispatchError:(NSString *)message;
- (void)onContentPauseOrResume:(bool)isPause;
- (void)dispatchPauseOrResume:(BOOL)isPause;
- (void)onContentPauseOrResume:(BOOL)isPause;
- (void)setPictureInPicture:(BOOL)isPictureInPicture;
- (void)clientAdRequest:(IMAAdsRequest *)request;
- (void)daiAdRequest:(IMAStreamRequest *)request;
Expand Down

0 comments on commit b32a846

Please sign in to comment.