Package com.brightcove.player.model
Class CuePoint
java.lang.Object
com.brightcove.player.model.MetadataObject
com.brightcove.player.model.CuePoint
- All Implemented Interfaces:
Serializable
,Comparable<CuePoint>
Represents the data of a single cue point.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Specifies the cue point type.static enum
Indicates the position of the cue point in relation to the entire video. -
Field Summary
Fields inherited from class com.brightcove.player.model.MetadataObject
properties, TAG
-
Constructor Summary
ConstructorDescriptionCuePoint
(int position, CuePoint.CuePointType type, Map<String, Object> properties) Deprecated.Deprecated.Use the construtor that takes a CuePointType rather than a string.CuePoint
(long position, CuePoint.CuePointType type, Map<String, Object> properties) Used to create a mid-roll (PositionType.POINT_IN_TIME) cue point at a specific position.CuePoint
(CuePoint.PositionType positionType, CuePoint.CuePointType type, Map<String, Object> properties) Used to create a pre-roll (PositionType.BEFORE) or post-roll (PositionType.AFTER) cue point.Deprecated.Use the construtor that use a CuePointType rather than a string. -
Method Summary
Methods inherited from class com.brightcove.player.model.MetadataObject
getIntegerProperty, getIntegerProperty, getLongProperty, getProperties, getStringProperty, getStringProperty
-
Constructor Details
-
CuePoint
@Deprecated public CuePoint(CuePoint.PositionType positionType, @NonNull String type, Map<String, Object> properties) Deprecated.Use the construtor that use a CuePointType rather than a string. This will guarantee that the CuePoint is of a known type and can be handled properly by the system. This method now throws IllegalArgumentException if the string value describing the cue point type does not specify a known cue point type. Currently supported values are "AD" or "CODE".Used to create a before (pre-roll) or after (post-roll) cue point.- Parameters:
positionType
- Either PositionType.Before (pre-roll) or PositionType.After (post-roll).type
- The type of the cue point. Valid values are: "AD" or "CODE".properties
- The properties describing this cue point.
-
CuePoint
public CuePoint(@NonNull CuePoint.PositionType positionType, @NonNull CuePoint.CuePointType type, Map<String, Object> properties) Used to create a pre-roll (PositionType.BEFORE) or post-roll (PositionType.AFTER) cue point.- Parameters:
positionType
- EitherCuePoint.PositionType.BEFORE
(pre-roll) orCuePoint.PositionType.AFTER
(post-roll).type
- EitherCuePoint.CuePointType.AD
orCuePoint.CuePointType.CODE
properties
- The properties describing this cue point.
-
CuePoint
Deprecated.Use the construtor that takes a CuePointType rather than a string. This will guarantee that the CuePoint is of a known type and can be handled properly by the system. This method now throws IllegalArgumentException if the string value describing the cue point type does not specify a known cue point type. Currently supported values are "AD" and "CODE".Used to create a point in time (mid-roll) cue point at a specific position.- Parameters:
position
- The offset from the beginning of the video, in milliseconds.type
- The type of the cue point. Valid values are "AD" or "CODE".properties
- The properties describing this cue point.
-
CuePoint
@Deprecated public CuePoint(int position, @NonNull CuePoint.CuePointType type, Map<String, Object> properties) Deprecated.Used to create a mid-roll (PositionType.POINT_IN_TIME) cue point at a specific position.- Parameters:
position
- The offset from the beginning of the video, in milliseconds.type
- Either CuePointType.AD or CuePointType.CODEproperties
- The properties describing this cue point.
-
CuePoint
Used to create a mid-roll (PositionType.POINT_IN_TIME) cue point at a specific position.- Parameters:
position
- The offset from the beginning of the video, in milliseconds.type
- Either CuePointType.AD or CuePointType.CODEproperties
- The properties describing this cue point.
-
-
Method Details
-
getPositionType
- Returns:
- The CuePoint.PositionType of this cue point.
-
getPosition
Deprecated.Returns the time offset of the cue point from the beginning of the video, in milliseconds.Note that this is only valid for PositionType.POINT_IN_TIME cue points.
- Returns:
- The position of the cue point as the number of milliseconds from the start of the video.
- Throws:
IllegalStateException
- if you call this method on any CuePoint instance whose position type is not PositionType.POINT_IN_TIME.
-
getPositionLong
public long getPositionLong()Returns the time offset of the cue point from the beginning of the video, in milliseconds.Note that this is only valid for PositionType.POINT_IN_TIME cue points.
- Returns:
- The position of the cue point as the number of milliseconds from the start of the video.
- Throws:
IllegalStateException
- if you call this method on any CuePoint instance whose position type is not PositionType.POINT_IN_TIME.
-
getType
Deprecated.Use getPositionType()- Returns:
- A string representation of the CuePointType of this cue point.
-
getCuePointType
- Returns:
- The CuePointType of this cue point.
-
compareTo
Compares this CuePoint object with the specified CuePoint object.For all CuePoints:
CuePoint.PositionType.BEFORE < CuePoint.PositionType.POINT_IN_TIME < CuePoint.PositionType.AFTERWhen both cue points being compared are PositionType.POINT_IN_TIME, then this < cuePoint if this.position < cuePoint.position.
- Specified by:
compareTo
in interfaceComparable<CuePoint>
- Parameters:
cuePoint
- The CuePoint to compare to this CuePoint.- Returns:
- -1 if this CuePoint is earlier in the timeline than the specified CuePoint; 0 if the two CuePoints are at the same time; 1 if this CuePoint is later in the timeline than the specified CuePoint.
-
equals
-
hashCode
public int hashCode() -
toString
- Overrides:
toString
in classMetadataObject
-