ServerSideAdIntegrationHandler
public protocol ServerSideAdIntegrationHandlerA handler for a server-side ad integration.
You can implement one or more of these methods to hook into various parts of the player’s lifecycle and perform your integration-specific ad handling.
Use the ServerSideAdIntegrationController provided by Ads.registerServerSideIntegration to update the state of your integration.
- 
                  setSource(source:Default implementation) Handler which will be called when a new source is loaded into the player. This allows the integration to transform the source description, e.g. by calling an external service to replace TypedSource.src(the content URL), or by adding a fixed pre-roll linear ad toSourceDescription.ads(the list of ads).Default ImplementationDeclarationSwift func setSource(source: SourceDescription) -> BoolParameterssourceThe original source description. Return ValueReturns whether the handler will be responsible for transforming the source. Should return falsein order to invoke default player behavior.
- 
                  skipAd(ad:Default implementation) Handler which will be called when an ad is requested to be skipped. To skip the ad, the handler should call ServerSideAdIntegrationController.skipAd.Remark This is only called for ads whose Ad.integrationmatchesServerSideAdIntegrationController.integration.Default ImplementationDeclarationSwift func skipAd(ad: Ad) -> BoolParametersadThe Adto be skipped.Return ValueReturns whether the handler will be responsible for skipping the ad. Should return falsein order to invoke default player behavior.
- 
                  resetSource()Default implementationHandler which will be called before a new source is loaded into the player, or before the player is destroyed. This allows the integration to clean up any source-specific resources, such as scheduled ads or pending HTTP requests. Remark If this handler is missing, the player will remove all remaining ads by calling ServerSideAdIntegrationController.removeAllAds.Default ImplementationDeclarationSwift func resetSource() -> BoolReturn ValueReturns whether the handler will be responsible for resetting the source. Should return falsein order to invoke default player behavior.
- 
                  destroy()Default implementationHandler which will be called when the player is destroyed. This allows the integration to clean up any resources, such as event listeners. Default ImplementationDeclarationSwift func destroy()
