Video Ads
The SDK provides an API to retrieve URLs which can be used to retreive the video ads. Each URL will return a VAST file. It is up to the client to handle the requests and displaying of the video ads. This can for example be done using the Google IMA SDK (Android, iOS).
InStream Ad Providers
The InStream ad provider handles the video ads for a single content video. For each video, create a new provider using the API getInStreamProvider()
. This allows you to have multiple content sessions in parallel with their independent ad providers. To request an ad block use the provider's getAdBlock()
method.
getAdBlock()
returns a single stringified url. The url will return a pod enabled VAST file. The VAST file can contain 1 or many advertisements depending on your configuration. Please contact your publisher manager to configure how many ads in each pre, mid or postroll block should contain.
Note: The SDK does NOT run any network requests when
getAdBlock()
is called. It is up to the player ad integration to take care of requesting the appropriate ad block(s) at the appropriate time(s).
It is only possible to request a single pre or post roll per provider. Requesting multiple pre or post rolls will return a null
and log a warning. However, you can request an unlimited number of midroll blocks per provider.
SevenOneAds.getInStreamProvider(<formatTopDomain>, <formatSubDomain>, <assetId>, <isLongPlay>) { inStreamProvider ->
val adBlock = inStreamProvider.getAdBlock(<InStreamType>)
// Handle received adBlock
}
SevenOneAds.shared.getInStreamProvider(formatTopDomain: <formatTopDomain>, formatSubDomain: <formatSubDomain>, assetId: <assetId>, isLongPlay: <isLongPlay>) { (inStreamProvider) in
let adBlock = inStreamProvider.getAdBlock(ofType: <InStreamType>)
// Handle received adBlock
}
formatTopDomain
: (Optional, default: null) This would be the main format of the current video, for example "football". The supported domains for your integration will be provided by SOM.formatSubDomain
: (Optional, default: null) This would be the sub-topic of the current video, for example "champions-league". The supported domains for your integration will be provided by SOM. Passing a format sub domain is optional. If no subdomain is passed, only the top domain will be used.assetId
: (Optional, default: null) sets the asset ID for the video's ads. This is your internal ID. The ID is optionally used for revenue reporting per content.isLongPlay
: (Optional, default: False) This flag should be set to True if the content is long and therefore should receive more advertisements. For short content set this flag to false.
Supported Video Ad Types (InStreamType)
preRoll
midRoll
postRoll