The roVideoPlayer sends the roVideoPlayerEvent with the following predicates that indicate its valid event types:
isStreamStarted() as Boolean
The video stream has started playing.
GetIndex() as Integer
Returns the number of seconds from play to start streaming.
GetInfo() as Object
Returns an Associative Array containing these members:
Member | Type | Description |
---|---|---|
Url | String | URL of video stream |
StreamBitrate | Integer | average bitrate of stream, in bits per second |
MeasuredBitrate | Integer | measured network bandwidth in kibibits per second, used to select stream |
IsUnderrun | Boolean | true if this is a rebuffer due to an underrun |
isPlaybackPosition() as Boolean
The current position in the video stream has changed. This is sent periodically while playing, as determined by the last call to ifVideoPlayer.SetPositionNotificationPeriod.
GetIndex() as Integer
Returns current position in stream, in seconds from the beginning.
GetInfo() as Object
Available as of firmware version 7.5
Member | Type | Description |
---|---|---|
ClipIdx | Integer | The zero starting index of the item in the content list this event is related to |
ClipPos | Integer | player position relative to the start of the clip in milliseconds |
isRequestFailed() as Boolean
Video playback has failed.
GetMessage() as String
Returns text description of error.
GetIndex() as Integer
Returns one of the following error IDs:
Value | Description |
---|---|
0 | Network error : server down or unresponsive, server is unreachable, network setup problem on the client. |
-1 | HTTP error: malformed headers or HTTP error result. |
-2 | Connection timed out |
-3 | Unknown error |
-4 | Empty list; no streams were specified to play |
-5 | Media error; the media format is unknown or unsupported |
-6 | DRM error |
GetInfo() as Object
Returns an AssociativeArray containing the same members as in isStreamStarted except IsUnderrun.
These additional members are available as of firmware version 7.5:
Member | Type | Description |
---|---|---|
ClipIdx | Integer | The zero starting index of the item in the content list this event is related to |
Ignored | Boolean | true if the error was ignored and the player skipped to the next item in the content list |
isStatusMessage() as Boolean
Status information is available.
GetMessage() as String
Returns one of the following strings or other diagnostic message.
"startup progress" |
"start of play" |
"playback stopped" |
"end of stream" |
"end of playlist" |
isFullResult() as Boolean
Video playback has completed at end of the content list.
isPaused() as Boolean
Video playback was paused by the user.
isResumed() as Boolean
Video playback has resumed.
isFormatDetected() as Boolean
This event is 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 following functions on the event:
GetMessage() as String
Returns a description of the message, i.e., "Format Detected".
GetInfo() as Object
Returns an associative array containing the following information:
Key | Value |
---|---|
audio | The format of the audio stream, if any |
video | The format of the video stream, if any |
captions | The format of the captioning data, if any |
isSegmentDownloadStarted() as Boolean
This event is fired when each individual segment in an HLS or smooth stream is about to be downloaded.
Specific information about the event can be obtained by calling the following functions on the event:
GetMessage() as String
Returns a description of the message, i.e., "Segment download started".
GetInfo() as Object
Returns an associative array containing the following information:
Key | Value |
---|---|
Sequence | Stream segment sequence number |
SegBitrate | Bitrate of the segment, in kilobits per second |
StartTime | Timestamp of the start of the segment data |
EndTime | Timestamp of the end of the segment data |
isDownloadSegmentInfo() as Boolean
This event is fired after each individual segment in an adaptive stream (HLS, Smooth, or DASH) has been downloaded.
Specific information about the event can be obtained by calling the following functions on the event:
GetMessage() as String
Returns a description of the message, i.e., "Download segment info".
GetIndex() as Integer
Returns the segment sequence number.
GetInfo() as Object
Returns an associative array containing the following information:
Key | Value |
---|---|
Status | Status of the download: 0 = success, nonzero = error |
Sequence | Stream segment sequence number (same as returned by GetIndex) |
SegUrl | Stream segment URL (i.e., .ts file for HLS, stream fragment URL for smooth) |
DownloadDuration | Amount of time spent downloading the segment, in milliseconds |
SegSize | Segment size, in bytes |
SegType | Type of data in the segment: 1=audio, 2=video, 3=captions, 0=mux |
Bitrate | Bitrate of the segment, in bits per second |
SegBitrate | Bitrate of the segment, in kilobits per second (equal to Bitrate / 1000) |
isStreamSegmentInfo() as Boolean
This event is fired at the beginning of playback of each individual segment in an HLS, DASH, or smooth stream.
Specific information about the event can be obtained by calling the following functions on the event:
GetMessage() as String
Returns a description of the message, i.e., "Stream segment info".
GetIndex() as Integer
Returns the segment start time in seconds.
GetInfo() as Object
Returns an associative array containing the following information:
Key | Value |
---|---|
StreamBandwidth | Bandwidth of the stream being played in kbps |
Sequence | Stream segment sequence number |
SegUrl | Stream segment URL (i.e., .ts file for HLS, stream fragment URL for smooth) |
SegStartTime | Segment start time (offset from start of stream) in milliseconds |
isTimedMetaData() as Boolean
This event is fired when an ID3 timecode has passed with an event that includes key/value pairs for timed metadata that the BrightScript channel is interested in.
All timed metadata is released after it is delivered to the BrightScript channel.
It is also released without delivery if the BrightScript channel did not indicate its interest in the data with a SetTimedMetaDataForKeys() call.
GetMessage() as String
Returns the string "Timed Metadata"
GetIndex() as Integer
Returns the PTS timecode
GetInfo() as Object
Returns an associative array of key/value pairs of timedMetadata at the PTS timecode specified in the index.
isCaptionModeChanged() as Boolean
The closed caption mode or track has been changed by the user. Further information on the event can be returned by calling the following functions on the event.
GetIndex() as Integer
Returns index of captions mode:
Index | Mode |
---|---|
0 | Off |
1 | On |
2 | Instant replay |
GetInfo() as Object
Always returns invalid.
GetMessage() as String
Returns a caption track name, such as: "eia608/1" ,"eia608/3", and so forth.
isRequestSucceeded() as Boolean
The player has finished playing one item in the content list.
GetIndex() as Integer
Returns the index of the item in the content list that finished playing
isListItemSelected() as Boolean
The player is about to start playing a new item in the content list.
GetIndex() as Integer
Returns the index of the item that is about to start playing
Example
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