Interface ServerSideAdIntegrationController
-
- All Implemented Interfaces:
public interface ServerSideAdIntegrationController
A controller to be used by your ServerSideAdIntegrationHandler to update the state of your custom server-side ad integration.
-
-
Method Summary
Modifier and Type Method Description abstract Ad
createAd(AdInit props, AdBreak adBreak)
Create a new ad. abstract Unit
updateAd(Ad ad, AdInit props)
Update the given ad. abstract Unit
updateAdProgress(Ad ad, Double progress)
Update the playback progression of the given ad. abstract Unit
beginAd(Ad ad)
Begin the given ad. abstract Unit
endAd(Ad ad)
End the given ad. abstract Unit
skipAd(Ad ad)
Skip the given ad. abstract Unit
removeAd(Ad ad)
Remove the given ad. abstract AdBreak
createAdBreak(AdBreakInit props)
Create a new ad break. abstract Unit
updateAdBreak(AdBreak adBreak, AdBreakInit props)
Update the given ad break. abstract Unit
removeAdBreak(AdBreak adBreak)
Remove the given ad break and all of its ads. abstract Unit
removeAllAds()
Remove all ads and ad breaks. abstract Unit
error(Throwable error)
Fire an AdErrorEvent on the player. abstract Unit
fatalError(Throwable error, ErrorCode code)
Fire a fatal ErrorEvent on the player. abstract String
getIntegration()
The identifier for this integration, as it was passed to Ads.registerServerSideIntegration. abstract List<Ad>
getAds()
The scheduled ads managed by this integration. abstract List<AdBreak>
getAdBreaks()
The scheduled ad breaks managed by this integration. -
-
Method Detail
-
createAd
abstract Ad createAd(AdInit props, AdBreak adBreak)
Create a new ad.
The ad will be added to Ads.getScheduledAds.
- Parameters:
props
- The initial properties to be set on the created ad.adBreak
- If given, appends the ad to the given existing AdBreak.
-
updateAd
abstract Unit updateAd(Ad ad, AdInit props)
Update the given ad.
- Parameters:
ad
- The ad to be updated.props
- The properties to be updated on the ad.
-
updateAdProgress
abstract Unit updateAdProgress(Ad ad, Double progress)
Update the playback progression of the given ad.
The player will fire progression events such as AdFirstQuartileEvent, AdMidpointEvent and AdThirdQuartileEvent.
- Parameters:
ad
- The ad to be updated.progress
- The playback progress, as a number between 0 (at the start of the ad) and 1 (at the end of the ad).
-
beginAd
abstract Unit beginAd(Ad ad)
Begin the given ad.
The ad will be added to Ads.getCurrentAds.
An AdBeginEvent will be fired.
-
endAd
abstract Unit endAd(Ad ad)
End the given ad.
The ad will be removed from Ads.getCurrentAds.
If the ad was currently playing, an AdEndEvent will be fired.
-
skipAd
abstract Unit skipAd(Ad ad)
Skip the given ad.
The ad will be removed from Ads.getCurrentAds.
If the ad was currently playing, an AdSkipEvent will be fired.
-
removeAd
abstract Unit removeAd(Ad ad)
Remove the given ad.
The ad will be removed from Ads.getCurrentAds and Ads.getScheduledAds.
If the ad was currently playing, it will first be ended.
-
createAdBreak
abstract AdBreak createAdBreak(AdBreakInit props)
Create a new ad break.
This can be used to indicate where ad breaks can be expected in advance, before populating those ad breaks with ads.
The ad break will be added to adBreaks.
- Parameters:
props
- The initial properties to be set on the created ad break.
-
updateAdBreak
abstract Unit updateAdBreak(AdBreak adBreak, AdBreakInit props)
Update the given ad break.
- Parameters:
adBreak
- The ad break to be updated.props
- The properties to be updated on the ad break.
-
removeAdBreak
abstract Unit removeAdBreak(AdBreak adBreak)
Remove the given ad break and all of its ads.
The ad break will be removed from adBreaks.
Any remaining ads in the ad break will be removed.
- Parameters:
adBreak
- The ad break to be removed.
-
removeAllAds
abstract Unit removeAllAds()
Remove all ads and ad breaks.
This is a shorthand for calling removeAdBreak on all ad breaks in adBreaks.
-
error
abstract Unit error(Throwable error)
Fire an AdErrorEvent on the player.
This does not stop playback.
- Parameters:
error
- The error.
-
fatalError
abstract Unit fatalError(Throwable error, ErrorCode code)
Fire a fatal ErrorEvent on the player.
This stops playback immediately. Use Player.setSource to load a new source.
- Parameters:
error
- The error.code
- The error code.
-
getIntegration
abstract String getIntegration()
The identifier for this integration, as it was passed to Ads.registerServerSideIntegration.
-
getAdBreaks
abstract List<AdBreak> getAdBreaks()
The scheduled ad breaks managed by this integration.
Use createAdBreak and removeAdBreak to add or remove ad breaks.
-
-
-
-