Class CuePoint

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CuePoint>

    public class CuePoint
    extends MetadataObject
    implements java.lang.Comparable<CuePoint>
    Represents the data of a single cue point.
    See Also:
    Serialized Form
    • Constructor Detail

      • CuePoint

        @Deprecated
        public CuePoint​(CuePoint.PositionType positionType,
                        @NonNull
                        java.lang.String type,
                        java.util.Map<java.lang.String,​java.lang.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

        @Deprecated
        public CuePoint​(int position,
                        @NonNull
                        java.lang.String type,
                        java.util.Map<java.lang.String,​java.lang.Object> properties)
        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,
                        java.util.Map<java.lang.String,​java.lang.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.CODE
        properties - The properties describing this cue point.
      • CuePoint

        public CuePoint​(long position,
                        @NonNull
                        CuePoint.CuePointType type,
                        java.util.Map<java.lang.String,​java.lang.Object> properties)
        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.CODE
        properties - The properties describing this cue point.
    • Method Detail

      • getPositionType

        public CuePoint.PositionType getPositionType()
        Returns:
        The CuePoint.PositionType of this cue point.
      • getPosition

        @Deprecated
        public int 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:
        java.lang.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:
        java.lang.IllegalStateException - if you call this method on any CuePoint instance whose position type is not PositionType.POINT_IN_TIME.
      • getType

        @Deprecated
        public java.lang.String getType()
        Deprecated.
        Use getPositionType()
        Returns:
        A string representation of the CuePointType of this cue point.
      • getCuePointType

        public CuePoint.CuePointType getCuePointType()
        Returns:
        The CuePointType of this cue point.
      • compareTo

        public int compareTo​(CuePoint cuePoint)
        Compares this CuePoint object with the specified CuePoint object.

        For all CuePoints:
        CuePoint.PositionType.BEFORE < CuePoint.PositionType.POINT_IN_TIME < CuePoint.PositionType.AFTER

        When both cue points being compared are PositionType.POINT_IN_TIME, then this < cuePoint if this.position < cuePoint.position.

        Specified by:
        compareTo in interface java.lang.Comparable<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

        public boolean equals​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object