GoogleInteractiveMediaAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
IMAStreamManagerDelegate
@protocol IMAStreamManagerDelegate
A callback protocol for IMAStreamManager.
-
Called when there is an IMAAdEvent.
Parameters
streamManager
|
the IMAStreamManager receiving the event
|
event
|
|
-
Called when there is an IMAAdEvent.
Parameters
streamManager
|
the IMAStreamManager receiving the error
|
error
|
|
-
Called when the ad is playing to give updates about ad progress.
Declaration
Swift
optional func streamManager(_ streamManager: IMAStreamManager, adDidProgressToTime time: TimeInterval, adDuration: TimeInterval, adPosition: Int, totalAds: Int, adBreakDuration: TimeInterval, adPeriodDuration: TimeInterval)
Objective-C
- (void)streamManager:(nonnull IMAStreamManager *)streamManager
adDidProgressToTime:(NSTimeInterval)time
adDuration:(NSTimeInterval)adDuration
adPosition:(NSInteger)adPosition
totalAds:(NSInteger)totalAds
adBreakDuration:(NSTimeInterval)adBreakDuration
adPeriodDuration:(NSTimeInterval)adPeriodDuration;
Parameters
streamManager
|
the IMAStreamManager tracking ad playback
|
time
|
the current ad playback time in seconds
|
adDuration
|
the total duration of the current ad in seconds
|
adPosition
|
the ad position of the current ad in the current ad break
|
totalAds
|
the total number of ads in the current ad break
|
adBreakDuration
|
the total duration of the current ad break in seconds
|
adPeriodDuration
|
the total duration of the current ad period in seconds. This includes ads
duration plus slate.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-21 UTC.
[null,null,["Last updated 2024-08-21 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eIMAStreamManagerDelegate\u003c/code\u003e protocol provides callbacks for monitoring ad events, errors, and progress within the \u003ccode\u003eIMAStreamManager\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can implement delegate methods to receive updates on ad playback, such as current time, duration, and position.\u003c/p\u003e\n"],["\u003cp\u003eError handling is facilitated through the \u003ccode\u003estreamManager:didReceiveAdError:\u003c/code\u003e method, providing insights into ad-related issues.\u003c/p\u003e\n"],["\u003cp\u003eDetailed ad information is available through callbacks, including ad break and period durations, along with the ad position within the break.\u003c/p\u003e\n"],["\u003cp\u003eThis protocol is essential for integrating and managing ad interactions within applications utilizing the Google Interactive Media Ads SDK.\u003c/p\u003e\n"]]],[],null,["# GoogleInteractiveMediaAds Framework Reference\n\nIMAStreamManagerDelegate\n========================\n\n @protocol IMAStreamManagerDelegate\n\nA callback protocol for IMAStreamManager.\n- `\n ``\n ``\n `\n\n ### [-streamManager:didReceiveAdEvent:](#/c:objc(pl)IMAStreamManagerDelegate(im)streamManager:didReceiveAdEvent:)\n\n `\n ` \n Called when there is an IMAAdEvent. \n\n #### Declaration\n\n Swift \n\n func streamManager(_ streamManager: ../Classes/IMAStreamManager.html, didReceive event: ../Classes/IMAAdEvent.html)\n\n Objective-C \n\n - (void)streamManager:(nonnull ../Classes/IMAStreamManager.html *)streamManager\n didReceiveAdEvent:(nonnull ../Classes/IMAAdEvent.html *)event;\n\n #### Parameters\n\n |-----------------------|------------------------------------------|\n | ` `*streamManager*` ` | the IMAStreamManager receiving the event |\n | ` `*event*` ` | the IMAAdEvent received |\n\n- `\n ``\n ``\n `\n\n ### [-streamManager:didReceiveAdError:](#/c:objc(pl)IMAStreamManagerDelegate(im)streamManager:didReceiveAdError:)\n\n `\n ` \n Called when there is an IMAAdEvent. \n\n #### Declaration\n\n Swift \n\n func streamManager(_ streamManager: ../Classes/IMAStreamManager.html, didReceive error: ../Classes/IMAAdError.html)\n\n Objective-C \n\n - (void)streamManager:(nonnull ../Classes/IMAStreamManager.html *)streamManager\n didReceiveAdError:(nonnull ../Classes/IMAAdError.html *)error;\n\n #### Parameters\n\n |-----------------------|------------------------------------------|\n | ` `*streamManager*` ` | the IMAStreamManager receiving the error |\n | ` `*error*` ` | the IMAAdError received |\n\n- `\n ``\n ``\n `\n\n ### [-streamManager:adDidProgressToTime:adDuration:adPosition:totalAds:adBreakDuration:adPeriodDuration:](#/c:objc(pl)IMAStreamManagerDelegate(im)streamManager:adDidProgressToTime:adDuration:adPosition:totalAds:adBreakDuration:adPeriodDuration:)\n\n `\n ` \n Called when the ad is playing to give updates about ad progress. \n\n #### Declaration\n\n Swift \n\n optional func streamManager(_ streamManager: ../Classes/IMAStreamManager.html, adDidProgressToTime time: TimeInterval, adDuration: TimeInterval, adPosition: Int, totalAds: Int, adBreakDuration: TimeInterval, adPeriodDuration: TimeInterval)\n\n Objective-C \n\n - (void)streamManager:(nonnull ../Classes/IMAStreamManager.html *)streamManager\n adDidProgressToTime:(NSTimeInterval)time\n adDuration:(NSTimeInterval)adDuration\n adPosition:(NSInteger)adPosition\n totalAds:(NSInteger)totalAds\n adBreakDuration:(NSTimeInterval)adBreakDuration\n adPeriodDuration:(NSTimeInterval)adPeriodDuration;\n\n #### Parameters\n\n |--------------------------|------------------------------------------------------------------------------------------------|\n | ` `*streamManager*` ` | the IMAStreamManager tracking ad playback |\n | ` `*time*` ` | the current ad playback time in seconds |\n | ` `*adDuration*` ` | the total duration of the current ad in seconds |\n | ` `*adPosition*` ` | the ad position of the current ad in the current ad break |\n | ` `*totalAds*` ` | the total number of ads in the current ad break |\n | ` `*adBreakDuration*` ` | the total duration of the current ad break in seconds |\n | ` `*adPeriodDuration*` ` | the total duration of the current ad period in seconds. This includes ads duration plus slate. |"]]