-
- All Implemented Interfaces:
-
com.brightcove.player.event.Component
@Emits(events = {EventType.PLAY, EventType.SET_CUE_POINTS, EventType.WILL_INTERRUPT_CONTENT, EventType.WILL_RESUME_CONTENT, FreeWheelEventType.LOCK, FreeWheelEventType.UNLOCK, EventType.SHOW_SEEK_CONTROLS, EventType.HIDE_SEEK_CONTROLS})@ListensFor(events = {EventType.COMPLETED, EventType.CUE_POINT, EventType.DID_INTERRUPT_CONTENT, EventType.DID_RESUME_CONTENT, EventType.PLAY, EventType.SEEK_TO, EventType.ACTIVITY_STARTED, EventType.FRAGMENT_STARTED, EventType.ACTIVITY_RESTARTED, EventType.ACTIVITY_RESUMED, EventType.FRAGMENT_RESUMED, EventType.ACTIVITY_PAUSED, EventType.FRAGMENT_PAUSED, EventType.ACTIVITY_STOPPED, EventType.FRAGMENT_STOPPED}) public class AdCuePointComponent extends AbstractComponent
Before Video playback, converts Slots in an IAdContext into relevant CuePoints, then during playback is responsible for handling FreeWheel ad Cuepoints emitted by the VideoController. Before Video playback (most likely during SET_SOURCE), the AdCueComponent creates a series of CuePoints based on the current populated AdContext.
It will create one CuePoint for all pre-roll ads (with CuePoint.Type of BEFORE), one CuePoint for all post-roll ads, and one for each mid-roll (POINT_IN_TIME) and overlay ad.
Due to the nature of the hooks in to the EventEmitter that the AdCuePointComponent creates, it should be instantiated as soon as possible after the FreeWheelController
-
-
Field Summary
Fields Modifier and Type Field Description public final static String
TYPE
public final static String
LINEAR
public final static String
NONLINEAR
public final static String
CLEAR_PLAYED_SLOTS
public final static String
CUSTOM_ID
public final static String
SLOT
private final List<ISlot>
preRollSlots
private final List<ISlot>
postRollSlots
private final List<ISlot>
playedSlots
private List<ISlot>
currentVideoAdSlots
private boolean
isLocked
private LiveVideoChecker
liveVideoChecker
-
Constructor Summary
Constructors Constructor Description AdCuePointComponent(EventEmitter emitter)
-
Method Summary
Modifier and Type Method Description List<ISlot>
getPreRollSlots()
List<ISlot>
getPostRollSlots()
List<ISlot>
getPlayedSlots()
List<ISlot>
getCurrentVideoAdSlots()
boolean
isLocked()
Determine if the controller is currently in 'isLocked' state. void
setLiveVideoChecker(@Nullable() LiveVideoChecker liveVideoChecker)
void
enable()
void
disable()
Removes the listeners from the Component. void
skipCurrentAd()
Skips the currently playing advertisement within the active Ad break (a.k. void
skipCurrentAdBreak()
Skips the current advertisement break (a.k. void
skipCurrentAds()
Functions the same as skipCurrentAdBreak void
unlock()
Tell the control to 'unlock' the normal Video playback control flow by re-emitting the Intercepted Event void
lock()
'Locks' the FreeWheelController; afterwards, certain events will be stopped and prevented from bubbling void
addCuePoints(IAdContext context)
Given an instance of IAdContext, parses the Ad slots contained in the context andgenerates CuePoints. -
-
Method Detail
-
getPreRollSlots
List<ISlot> getPreRollSlots()
-
getPostRollSlots
List<ISlot> getPostRollSlots()
-
getPlayedSlots
List<ISlot> getPlayedSlots()
-
getCurrentVideoAdSlots
List<ISlot> getCurrentVideoAdSlots()
-
isLocked
boolean isLocked()
Determine if the controller is currently in 'isLocked' state. If in isLocked state, certain events will be blockedfrom travelling down the event chain if seen by the controller.
-
setLiveVideoChecker
void setLiveVideoChecker(@Nullable() LiveVideoChecker liveVideoChecker)
-
enable
void enable()
-
disable
void disable()
Removes the listeners from the Component. Should be called before a new AdCuePointComponent is created
-
skipCurrentAd
void skipCurrentAd()
Skips the currently playing advertisement within the active Ad break (a.k.a ISlot)and plays the next advertisement in the break. If there are no pending advertisements with incurrent Ad break, then the normal playback will be resume automatically.
This method must be called while an Ad break is progress. Calling the method at othertimes will have no effect.
-
skipCurrentAdBreak
void skipCurrentAdBreak()
Skips the current advertisement break (a.k.a ISlot). Subsequent advertisement breakswill play at scheduled cue points and can be skipped again by calling theskipCurrentAdBreak method again.
This method must be called while an Ad break is progress. Calling the method at othertimes will have no effect.
Please note that an break may contain more than one advertisement. Calling this method atany point during the break will cause all advertisements in the current break to be skipped.
-
skipCurrentAds
@Deprecated() void skipCurrentAds()
Functions the same as skipCurrentAdBreak
-
unlock
void unlock()
Tell the control to 'unlock' the normal Video playback control flow by re-emitting the Intercepted Event
-
lock
void lock()
'Locks' the FreeWheelController; afterwards, certain events will be stopped and prevented from bubbling
-
addCuePoints
void addCuePoints(IAdContext context)
Given an instance of IAdContext, parses the Ad slots contained in the context andgenerates CuePoints. It will generate one Cuepoint for PreRoll Ads, one for PostRoll, andindividual cue points for the midroll and overlay.
- Parameters:
context
- A populated IAdContext (i.e.
-
-
-
-