roVideoPlayerEvent

The roVideoPlayer sends the roVideoPlayerEvent with the following predicates that indicate its valid event types:

Supported methods

isPaused() as Boolean

Checks whether video playback was paused by the user. This method returns true if video playback was paused; otherwise, it returns false.

isListItemSelected() as Boolean

Checks whether the video player is about to start playing a new item in the content list. This method returns true if a new item in the content list was selected; otherwise, it returns false.

GetIndex() as Integer

Returns the index of the item that is about to start playing.

isFormatDetected() as Boolean

Checks whether an event has been fired when the format of all tracks in the media stream have been identified.

Specific information about the event can be obtained by calling the GetMessages() and GetInfo() methods on the event.

GetMessage() as String

Returns a description of the message (for example, "Format Detected").

GetInfo() as Object

Returns information about the video player event. This method returns an roAssociativeArray that contains the following keys:

KeyValue
audioThe format of the audio stream, if any
captionsThe format of the captioning data, if any
videoThe format of the video stream, if any

isRequestFailed() as Boolean

Checks whether video playback has failed. This method returns true if video playback failed; otherwise, it returns false.

Specific information about the event can be obtained by calling the GetMessage(), GetIndex(), and GetInfo() methods on the event.

GetMessage() as String

Returns a description of the message (for example, "Segment download started").

GetIndex() as Integer

Returns the error ID, which may be one of the following values:

ValueDescription
0Network error : server down or unresponsive, server is unreachable, network setup problem on the client.
-1HTTP error: malformed headers or HTTP error result.
-2Connection timed out
-3Unknown error
-4Empty list; no streams were specified to play
-5Media error; the media format is unknown or unsupported
-6DRM error

GetInfo() as Object

Returns an associative array containing information about the event failure. The associative array contains the following key-value pairs:

KeyTypeValue
ClipIdxIntegerThe zero starting index of the item in the content list this event is related to.
IgnoredBooleanTrue if the error was ignored and the player skipped to the next item in the content list.

isSegmentDownloadStarted() as Boolean

Checks whether the individual segments in an HLS or smooth stream are about to be downloaded. This method returns true if segments in the stream are going to be downloaded; otherwise, it returns false.

Specific information about the event can be obtained by calling the GetMessages() and GetInfo() methods on the event.

GetMessage() as String

Returns a description of the message (for example, "Segment download started").

GetInfo() as Object

Returns an associative array containing the following information about the segment download event:

KeyValue
SequenceStream segment sequence number
SegBitrateBitrate of the segment, in kilobits per second
StartTimeTimestamp of the start of the segment data
EndTimeTimestamp of the end of the segment data

isStreamStarted() as Boolean

Checks whether the video stream has started playing. This method returns true if the video stream has started playing; otherwise, it returns false. Specific information about the event can be obtained by calling the GetIndex() and GetInfo() methods on the event.

GetIndex() as Integer

Returns the segment sequence number.

GetInfo() as Object

Returns an associative array containing the following information about the stream started event:

KeyTypeValue
UrlStringURL of video stream
StreamBitrateIntegeraverage bitrate of stream, in bits per second
MeasuredBitrateIntegermeasured network bandwidth in kibibits per second, used to select stream
IsUnderrunBooleantrue if this is a rebuffer due to an underrun

isStatusMessage() as Boolean

Checks whether status information or other diagnostic message is available. This method returns true if status information or diagnostic message is available; otherwise, it returns false. Specific information about the event can be obtained by calling the GetMessage() method on the event.

GetMessage() as String

Returns status information or other diagnostic message, which may be one of the following:

  • "startup progress"
  • "start of play"
  • "playback stopped"
  • "end of stream" (deprecated)
  • "end of playlist" (deprecated)

isFullResult() as Boolean

Checks whether video playback has completed at the end of the content list. This method returns true if video playback has completed at the end of the content list; otherwise, it returns false.

isResumed() as Boolean

Checks whether video playback has resumed. This method returns true if video playback has resumed; otherwise, it returns false.

isCaptionModeChanged() as Boolean

Checks whether closed caption mode or track has been changed by the user. This method returns true if closed caption mode or track has been changed by the user; otherwise, it returns false. Specific information about the event can be obtained by calling the GetMessage(), GetIndex(), and GetInfo() methods on the event.

GetMessage() as String

Returns a caption track name, such as: "eia608/1" ,"eia608/3", and so on.

GetIndex() as Integer

Returns the index of the captions mode, which may be one of the following values:

IndexMode
0Off
1On
2Instant replay

GetInfo() as Object

NameReturn TypeReturn ValueDescription
GetInfoObjectInvalidThis method always returns invalid.

Example: isCaptionModeChanged() Event

Function showVideoScreen(episode As Object)
  port = CreateObject("roMessagePort")
  screen = CreateObject("roVideoScreen")
  'some video stream
  '...
  'etc...
  episode.SubtitleConfig : {
    TrackName : "eia608/1"
    }
  screen.SetContent(episode)
  screen.SetMessagePort(port)
  screen.Show()
  while true
    msg = wait(0, port)
    if type(msg) = "roVideoScreenEvent" then
      if msg.isCaptionModeChanged()
        print "Caption Mode Changed"
        print "Caption Mode: "; msg.GetIndex()
        print "Caption track: "; msg.GetMessage()
      end if
    end if
  end while
End Function

isTimedMetaData() as Boolean

Checks whether an ID3 timecode has passed with an event that includes key-value pairs for timed metadata that the BrightScript app is interested in.

All timed metadata is released after it is delivered to the BrightScript app. It is also released without delivery if the BrightScript app did not indicate its interest in the data with a SetTimedMetaDataForKeys() method call.

This method returns true if an ID3 timecode has passed; otherwise, it returns false. Specific information about the event can be obtained by calling the GetMessage(), GetIndex(), and GetInfo() methods on the event.

GetMessage() as String

Returns the string "Timed Metadata".

GetIndex() as Integer

Returns the PTS timecode.

NameReturn TypeReturn ValueDescription
GetIndexIntegerPTS timecode.

GetInfo() as Object

Returns an associative array with timedMetadata at the PTS timecode specified in the index.

isPlaybackPosition() as Boolean

Checks whether the current position in the video stream has changed. This event is sent periodically while playing, as determined by the last call to ifVideoPlayer.SetPositionNotificationPeriod. This method returns true if the current position in the video stream has changed; otherwise, it returns false. Specific information about the event can be obtained by calling the GetIndex() and GetInfo() methods on the event.

GetIndex() as Integer

Returns current position in the stream (in seconds) from the beginning.

GetInfo() as Object

Returns an roAssociativeArray array with the following key-value pairs:

MemberTypeValue
ClipIdxIntegerThe zero starting index of the item in the content list this event is related to
ClipPosIntegerThe player position relative to the start of the clip in milliseconds

isStreamSegmentInfo() as Boolean

Checks whether playback has begun of a segment in an HLS, DASH, or smooth stream. This method returns true if the playback of a segment in an HLS, DASH, or smooth stream has begun; otherwise, it returns false. Specific information about the event can be obtained by calling the GetMessage(), GetIndex() and GetInfo() methods on the event.

GetMessage() as String

Returns a description of the message (for example, "Stream segment info").

GetIndex() as Integer

Returns the segment start time in seconds.

GetInfo() as Object

Returns an associative array with the following information about the stream segment:

KeyValue
StreamBandwidthBandwidth of the stream being played in kbps
SegStartTimeSegment start time (offset from start of stream) in milliseconds
SequenceStream segment sequence number
SegUrlStream segment URL (i.e., .ts file for HLS, stream fragment URL for smooth)
HdrModeIndicates the HDR format of the content, which may be one of the following values:
  • 0: UNKNOWN
  • 1: NONE (SDR)
  • 2: HDR10
  • 3: DOLBY_VISION
  • 4: HLG10
  • 5: HDR10_PLUS
  • 6: SL_HDR2

isDownloadSegmentInfo() as Boolean

Checks whether a segment in an adaptive stream (HLS, Smooth, or DASH) has been downloaded. This method returns true if a segment in an adaptive stream (HLS, Smooth, or DASH) has been downloaded; otherwise, it returns false. Specific information about the event can be obtained by calling the GetMessage(), GetIndex() and GetInfo() methods on the event.

GetMessage() as String

Returns a description of the message (for example, "Download segment info").

GetIndex() as Integer

Returns the segment sequence number.

GetInfo() as Object

Returns an associative array containing the following information about the segment download: