@Emits(events={"adBreakCompleted","adBreakStarted","adCompleted","adError","adPaused","adProgress","adResumed","adStarted","play","setCuePoints","willInterruptContent","willResumeContent","freewheelLock","freewheelUnlock","showSeekControls","hideSeekControls"}) @ListensFor(events={"completed","cuePoint","didInterruptContent","didResumeContent","play","seekTo","activityStarted","fragmentStarted","activityRestarted","activityResumed","fragmentResumed","activityPaused","fragmentPaused","activityStopped","fragmentStopped"}) 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
FreeWheelController
,
CuePoint
,
IAdContext
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLEAR_PLAYED_SLOTS
Flag that when added to a COMPLETED event enables the clearing
of the playedSlots, so ads will be shown again upon replay.
|
static java.lang.String |
CUSTOM_ID |
static java.lang.String |
LINEAR |
static java.lang.String |
NONLINEAR |
static java.lang.String |
SLOT |
static java.lang.String |
TYPE |
eventEmitter, listenerTokens
Constructor and Description |
---|
AdCuePointComponent(EventEmitter emitter) |
Modifier and Type | Method and Description |
---|---|
void |
addCuePoints(tv.freewheel.ad.interfaces.IAdContext context)
Given an instance of IAdContext, parses the Ad slots contained in the context and
generates CuePoints.
|
void |
disable()
Removes the listeners from the Component.
|
void |
enable() |
java.util.List<tv.freewheel.ad.interfaces.ISlot> |
getCurrentVideoAdSlots() |
java.util.List<tv.freewheel.ad.interfaces.ISlot> |
getPlayedSlots() |
java.util.List<tv.freewheel.ad.interfaces.ISlot> |
getPostRollSlots() |
java.util.List<tv.freewheel.ad.interfaces.ISlot> |
getPreRollSlots() |
boolean |
isLocked()
Determine if the controller is currently in 'isLocked' state.
|
void |
lock()
'Locks' the FreeWheelController; afterwards, certain events will be stopped and prevented from bubbling
|
void |
setLiveVideoChecker(LiveVideoChecker liveVideoChecker) |
void |
skipCurrentAd()
Skips the currently playing advertisement within the active Ad break (a.k.a
ISlot )
and plays the next advertisement in the break. |
void |
skipCurrentAdBreak()
Skips the current advertisement break (a.k.a
ISlot ). |
void |
skipCurrentAds()
Deprecated.
This method will be removed in a future release. Please update your code at the
earliest to use
skipCurrentAdBreak() method instead. |
void |
unlock()
Tell the control to 'unlock' the normal Video playback control flow by re-emitting the Intercepted Event
|
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
public static final java.lang.String TYPE
public static final java.lang.String LINEAR
public static final java.lang.String NONLINEAR
public static final java.lang.String CLEAR_PLAYED_SLOTS
public static final java.lang.String CUSTOM_ID
public static final java.lang.String SLOT
public AdCuePointComponent(EventEmitter emitter)
public void setLiveVideoChecker(@Nullable LiveVideoChecker liveVideoChecker)
public void enable()
public void disable()
public java.util.List<tv.freewheel.ad.interfaces.ISlot> getPreRollSlots()
public java.util.List<tv.freewheel.ad.interfaces.ISlot> getPostRollSlots()
public java.util.List<tv.freewheel.ad.interfaces.ISlot> getCurrentVideoAdSlots()
public java.util.List<tv.freewheel.ad.interfaces.ISlot> getPlayedSlots()
public 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 in
current 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 other times will have no effect.
skipCurrentAdBreak()
public void skipCurrentAdBreak()
Skips the current advertisement break (a.k.a ISlot
). Subsequent advertisement breaks
will play at scheduled cue points and can be skipped again by calling the
skipCurrentAdBreak method again.
This method must be called while an Ad break is progress. Calling the method at other times will have no effect.
Please note that an break may contain more than one advertisement. Calling this method at any point during the break will cause all advertisements in the current break to be skipped.
skipCurrentAd()
public void skipCurrentAds()
skipCurrentAdBreak()
method instead.skipCurrentAdBreak()
public void unlock()
public void lock()
public boolean isLocked()
public void addCuePoints(tv.freewheel.ad.interfaces.IAdContext context)
context
- A populated IAdContext (i.e. it contains ad information) from which to create CuePointsCuePoint
,
IAdContext