Interface ServerSideAdIntegrationHandler
-
- All Implemented Interfaces:
@ApiStatus.Experimental() public interface ServerSideAdIntegrationHandler
A 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 ServerSideAdIntegrationFactory to update the state of your integration.
-
-
Method Summary
Modifier and Type Method Description SourceDescription
setSource(SourceDescription source)
Handler which will be called when a new source is loaded into the player. Unit
skipAd(Ad ad)
Handler which will be called when an ad is requested to be skipped. Unit
resetSource()
Handler which will be called before a new source is loaded into the player, or before the player is destroyed. Unit
destroy()
Handler which will be called when the player is destroyed. -
-
Method Detail
-
setSource
SourceDescription setSource(SourceDescription source)
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 the content URL, or by adding a fixed pre-roll linear ad to the list of ads.
If this handler throws an error, the player fires a fatal ErrorEvent (as if by calling ServerSideAdIntegrationController.fatalError).
-
skipAd
Unit skipAd(Ad ad)
Handler which will be called when an ad is requested to be skipped.
To skip the ad, the handler should call ServerSideAdIntegrationController.skipAd.
This is only called for ads whose integration matches ServerSideAdIntegrationController.integration.
If this handler is missing, the player will always skip the ad by calling ServerSideAdIntegrationController.skipAd.
If this handler throws an error, the player fires a non-fatal AdErrorEvent (as if by calling ServerSideAdIntegrationController.error).
-
resetSource
Unit resetSource()
Handler 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.
If this handler is missing, the player will remove all remaining ads by calling ServerSideAdIntegrationController.removeAllAds.
If this handler throws an error, the player fires a fatal ErrorEvent (as if by calling ServerSideAdIntegrationController.fatalError).
-
-
-
-