logo

THEOplayer > Ads

Ads interface

Inherits from EventDispatcher<AdsEventMap> . See parent page for inherited properties and methods.

The API for advertisements.

Signature:

export interface Ads extends EventDispatcher<AdsEventMap> 

Remarks


- Integrates with 'theo', 'google-ima', 'google-dai' or 'freewheel'.

Properties

Property

Type

Description

currentAdBreak

AdBreak | null

The currently playing ad break.

currentAds

Ad[]

List of currently playing ads.

playing

boolean

Whether a linear ad is currently playing.

scheduledAdBreaks

AdBreak[]

List of ad breaks which still need to be played.

scheduledAds

Ad[]

List of ads which still need to be played.

Methods

Method

Description

schedule​(adDescription: AdDescription): void

Add an ad break request.

skip​(): void

Skip the current linear ad.

Property Details

currentAdBreak

The currently playing ad break.

Signature:

readonly currentAdBreak: AdBreak | null;

currentAds

List of currently playing ads.

Signature:

readonly currentAds: Ad[];

playing

Whether a linear ad is currently playing.

Signature:

playing: boolean;

scheduledAdBreaks

List of ad breaks which still need to be played.

Signature:

readonly scheduledAdBreaks: AdBreak[];

scheduledAds

Warning: This API is deprecated.

Superseded by Ads.scheduledAdBreaks.

List of ads which still need to be played.

Signature:

readonly scheduledAds: Ad[];

Remarks


- Only available in the 'theo' ad integration.

Method Details

schedule

Add an ad break request.

Signature:

schedule(adDescription: AdDescription): void;

Parameters

Parameter

Type

Description

adDescription

AdDescription

Describes the ad break to be scheduled.

Remarks


- Available since v2.18.0.
- Prefer scheduling ad breaks up front through SourceConfiguration.ads.

skip

Skip the current linear ad.

Signature:

skip(): void;

Remarks


- This will have no effect when the current linear ad is (not yet) skippable.

github
Make sure to follow us on GitHub!
THEO-logo-white
twitter
facebook
linkedin
Copyright © 2020. All Rights Reserved.
Leuven
New York
Singapore
Barcelona