JWCueTime

@objcMembers
public class JWCueTime : NSObject

A JWCueTime can represent any accepted format of time in a cue.

  • Number of seconds from the beginning of the content.

    Declaration

    Swift

    public var seconds: TimeInterval { get }
  • The point at which the cue exists within the video, expressed as a percentage from 0 - 100.

    Declaration

    Swift

    public var percentage: Double { get }
  • Initialize a JWCueTime with a TimeInterval value.

    Note

    This initializer will fail if value is not a positive number, and doing so will return nil.

    Declaration

    Swift

    public init?(seconds: TimeInterval)

    Parameters

    seconds

    Number of seconds from the beginning of the content.

  • Initialize a JWCueTime with a Double value.

    Note

    This initializer will fail if the parameter value is not in range of 0 - 100, and doing so will return nil.

    Declaration

    Swift

    public init?(percentage: Double)

    Parameters

    percentage

    The point at which the cue exists within the media, expressed as a percentage from 0 - 100 relative to the duration of the content.

  • Initialize a JWCueTime with a String value representation of percentage.

    Note

    This initializer can fail, and doing so will return nil.

    Declaration

    Swift

    public init?(percentageString: String)

    Parameters

    percentageString

    The point at which the cue exists within the video, expressed as a percentage from 0 - 100. With the format “{percent}%”.

  • Initializes and returns a JWCueTime with the provided seconds. This is used as a shorthand initializer when type context is provided.

    • Use example: var cue: JWCueTime //... cue = .seconds(20)

    Declaration

    Swift

    @objc
    public static func seconds(_ seconds: TimeInterval) -> JWCueTime?

    Parameters

    seconds

    Number of seconds from the beginning of the content.

    Return Value

    a JWCueTime instance with seconds value, nil if value is not valid.

  • Initializes and returns a JWCueTime with the provided percentage in Double. This is used as a shorthand initializer when type context is provided.

    • Percentage is a value from 0-100, relative to the duration of the media.
    • Use example: var cue: JWCueTime //... cue = .percentage(25.0)

    Declaration

    Swift

    public static func percentage(_ percentage: Double) -> JWCueTime?

    Parameters

    percentage

    The point at which the cue exists within the media, expressed as a percentage from 0 - 100 relative to the duration of the content.

    Return Value

    a JWCueTime instance with percentage value. nil if value is not valid.

  • Compares two JWCueTime instances for equality. This is used through the “==” method.

    Declaration

    Swift

    public override func isEqual(_ object: Any?) -> Bool
  • Equality testing.

    Declaration

    Swift

    public static func == (lhs: JWCueTime, rhs: JWCueTime) -> Bool

    Parameters

    lhs

    The lefthand value.

    rhs

    The righthand value.