Class AdCuePointComponent
- All Implemented Interfaces:
Component
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
- See Also:
-
FreeWheelController
CuePoint
IAdContext
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Flag that when added to a COMPLETED event enables the clearing of the playedSlots, so ads will be shown again upon replay.static final String
static final String
static final String
static final String
static final String
Fields inherited from class com.brightcove.player.event.AbstractComponent
eventEmitter, listenerTokens
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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()
List<tv.freewheel.ad.interfaces.ISlot>
List<tv.freewheel.ad.interfaces.ISlot>
List<tv.freewheel.ad.interfaces.ISlot>
List<tv.freewheel.ad.interfaces.ISlot>
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 bubblingvoid
setLiveVideoChecker
(LiveVideoChecker liveVideoChecker) void
Skips the currently playing advertisement within the active Ad break (a.k.aISlot
) and plays the next advertisement in the break.void
Skips the current advertisement break (a.k.aISlot
).void
Deprecated.This method will be removed in a future release.void
unlock()
Tell the control to 'unlock' the normal Video playback control flow by re-emitting the Intercepted EventMethods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
Field Details
-
TYPE
- See Also:
-
LINEAR
- See Also:
-
NONLINEAR
- See Also:
-
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.- See Also:
-
CUSTOM_ID
- See Also:
-
SLOT
- See Also:
-
-
Constructor Details
-
AdCuePointComponent
-
-
Method Details
-
setLiveVideoChecker
-
enable
public void enable() -
disable
public void disable()Removes the listeners from the Component. Should be called before a new AdCuePointComponent is created -
getPreRollSlots
- Returns:
- the pre-roll Ad Slots list.
-
getPostRollSlots
- Returns:
- the post-roll Ad Slots list.
-
getCurrentVideoAdSlots
- Returns:
- the list of Ad Slots that are about to be played in the Ad break. As soon as the ad starts playing, it's removed from the list. Returns empty if there is only one slot.
-
getPlayedSlots
- Returns:
- the list of played Ad slots. As soon as the next Ad slot starts playing, it's added to the list.
-
skipCurrentAd
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.
- See Also:
-
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.
- See Also:
-
skipCurrentAds
public void skipCurrentAds()Deprecated.This method will be removed in a future release. Please update your code at the earliest to useskipCurrentAdBreak()
method instead.Functions the same asskipCurrentAdBreak()
-
unlock
public void unlock()Tell the control to 'unlock' the normal Video playback control flow by re-emitting the Intercepted Event -
lock
public void lock()'Locks' the FreeWheelController; afterwards, certain events will be stopped and prevented from bubbling -
isLocked
public boolean isLocked()Determine if the controller is currently in 'isLocked' state. If in isLocked state, certain events will be blocked from travelling down the event chain if seen by the controller.- Returns:
- TRUE iff the controller is currently in a locked state.
-
addCuePoints
public void addCuePoints(tv.freewheel.ad.interfaces.IAdContext context) Given an instance of IAdContext, parses the Ad slots contained in the context and generates CuePoints. It will generate one Cuepoint for PreRoll Ads, one for PostRoll, and individual cue points for the midroll and overlay.- Parameters:
context
- A populated IAdContext (i.e. it contains ad information) from which to create CuePoints- See Also:
-
CuePoint
IAdContext
-