Ads
public protocol Ads : EventDispatcherProtocolThe Ads object helps you configure and control ads within THEOplayer.
- 
                  
                  Returns whether a linear ad is currently playing. DeclarationSwift var playing: Bool { get }
- 
                  
                  Returns an array of the currently active ads. Remark - Can be linear and/or non linear.
- If there are no ads playing, the method returns an empty array.
 DeclarationSwift var currentAds: [Ad] { get }
- 
                  
                  Returns an array of ads that still need to be played. DeclarationSwift var scheduledAds: [Ad] { get }
- 
                  
                  Schedules an ad. Remark Remark: - It will be added on top of the already existing ad(s).
- If you want to replace the ads with new ones or set ads while setting up the player, you should set a SourceDescriptionwith anAdDescription.
 DeclarationSwift func schedule(adDescription: AdDescription)ParametersadDescriptionThe ad to schedule. 
- 
                  
                  Skips the current linear ad. Remark - This is only possible if the player has already played beyond the time where it can be skipped.
- This will have no effect when the current linear ad is not (yet) skippable.
 DeclarationSwift func skip()
- 
                  
                  Adds the given event listener of the given ad event type. Remark When attaching a listener on the wrong object the application will crash. DeclarationSwift func addEventListener<E>(type: EventType<E>, listener: @escaping (E) -> ()) -> EventListener where E : EventProtocolParameterstypeThe type of the added event listener. See AdsEventTypesfor possible values.listenerClosure called when event is dispatched. Return ValueEventListener that can be removed. 
- 
                  
                  Removes the given event listener of the given ad event type. DeclarationSwift func removeEventListener<E>(type: EventType<E>, listener: EventListener) where E : EventProtocolParameterstypeThe type of the removed event listener. See AdsEventTypesfor possible values.listenerEventListener object that has been return on addEventListener. 
- 
                  
                  The Open Measurement API. Remark Only available if the Google DAI Feature is enabled.DeclarationSwift var omid: Omid { get }
- 
                  
                  Register a custom advertisement integration. This allows you to integrate with third-party advertisement providers, and have them report their ads and ad-related events through the THEOplayer AdsAPI.DeclarationSwift func registerServerSideIntegration(integrationId: String, integrationFactory: (_ controller: ServerSideAdIntegrationController) -> ServerSideAdIntegrationHandler)ParametersintegrationIdAn identifier of the integration. integrationFactoryFactory that will construct an ServerSideAdIntegrationHandlerfor this integration.
