Bitmovin-Player-Roku-SDK v1.73.0

Documentation for Bitmovin Player Roku SDK

Using the API

The Player object contains APIs available for the Bitmovin Roku Player. In order to use Bitmovin Player we first need to download the Bitmovin Player component library

                  m.bitmovinPlayerLibrary = createObject("roSGNode", "ComponentLibrary")
                  m.bitmovinPlayerLibrary.id = "BitmovinPlayerLibrary"
                  m.bitmovinPlayerLibrary.uri = "BITMOVIN_PLAYER_LIBRARY_URL"
                

Adding the Bitmovin Player component library to the scene or a SceneGraph component will start the download of the library

m.top.appendChild(m.bitmovinPlayerLibrary)

Once the loadStatus field of the Bitmovin Player component library changes to ready, we can use it to reference the Bitmovin Player component

m.bitmovinPlayer = createObject("roSGNode", "BitmovinPlayerLibrary:BitmovinPlayer")

To receive events from the Bitmovin Player, we need to assign the observer to the specific field of the Bitmovin Player that we want to receive the events for

m.bitmovinPlayer.observeFieldScoped(m.bitmovinPlayer.bitmovinFields.IMPRESSION, "onImpression")

In order to use the available Bitmovin Player's API functions, we need to utilize Roku's built-in callFunc() API. For example, the line below calls the PLAY function on Bitmovin Player

m.bitmovinPlayer.callFunc(m.bitmovinPlayer.bitmovinFunctions.PLAY, invalid)

The Bitmovin Player API is not available anymore after the destroy event is triggered.

Index

Properties

BitmovinFields

BitmovinFields: assocarray

Always contains an associative array with the possible observable player fields (to be used with observeField)

Properties

  • AUDIO_DOWNLOAD_QUALITY_CHANGED : audioDownloadQualityChanged

  • VIDEO_DOWNLOAD_QUALITY_CHANGED : videoDownloadQualityChanged

  • AD_BREAK_FINISHED : adBreakFinished

  • AD_BREAK_STARTED : adBreakStarted

  • AD_ERROR : adError

  • AD_INTERACTION : adInteraction

  • AD_QUARTILE : adQuartile

  • AD_FINISHED : adFinished

  • AD_STARTED : adStarted

  • AD_SKIPPED : adSkipped

  • AUDIO_CHANGED : audioChanged

  • CURRENT_TIME : currentTime

  • DESTROY : destroy

  • DOWNLOAD_FINISHED : downloadFinished

  • ERROR : error

  • IMPRESSION: impression

  • LICENSE_VALIDATED: licenseValidated

  • METADATA : metadata

  • MUTED : muted

  • PLAY : play

  • PLAYER_STATE : playerState

  • SEEK : seek

  • SEEKED : seeked

  • SOURCE_LOADED : sourceLoaded

  • SOURCE_UNLOADED : sourceUnloaded

  • TIME_SHIFT : timeShift

  • TIME_SHIFTED : timeShifted

  • UNMUTED : unmuted

  • WARNING : warning

  • TIME_CHANGED : timeChanged

  • SUBTITLE_ADDED : subtitleAdded

  • SUBTITLE_CHANGED : subtitleChanged

  • DEMAND_API_QUERY_ADS_RESULT : demandApiQueryAdsResult

  • DEMAND_API_FETCH_ADS_RESULT : demandApiFetchAdsResult

  • MANIFEST_DATA_PARSED : manifestDataParsed

BitmovinFunctions

BitmovinFunctions: assocarray

Always contains an associative array with values for the possible API functions (to be called with callFunc)

Properties

  • SETUP : setup

  • PLAY : play

  • INSTANT_REPLAY : instantReplay

  • PAUSE : pause

  • PRELOAD : preload

  • SEEK : seek

  • MUTE : mute

  • UNMUTE : unmute

  • CAPTION_MODE : captionMode

  • SET_CAPTION_MODE : setCaptionMode

  • IS_MUTED : isMuted

  • IS_PLAYING : isPlaying

  • IS_PAUSED : isPaused

  • IS_STALLED : isStalled

  • AVAILABLE_SUBTITLES : availableSubtitles

  • GET_SUBTITLE: getSubtitle

  • SET_SUBTITLE: setSubtitle

  • AVAILABLE_AUDIO : availableAudio

  • GET_AUDIO : getAudio

  • SET_AUDIO : setAudio

  • UNLOAD : unload

  • LOAD : load

  • TIME_SHIFT : timeShift

  • GET_TIME_SHIFT : getTimeShift

  • GET_MAX_TIME_SHIFT : getMaxTimeShift

  • IS_LIVE : isLive

  • GET_CONFIG : getConfig

  • GET_DURATION : getDuration

  • SET_HTTP_HEADERS : setHttpHeaders

  • GET_THUMBNAIL : getThumbnail

  • AD_LIST : ad_list

  • AD_SCHEDULE : ad_schedule

  • AD_GET_ACTIVE_AD_BREAK : ad_getActiveAdBreak

  • AD_DISCARD_AD_BREAK : ad_discardAdBreak

  • GET_VERSION : getVersion

  • DESTROY : destroy

  • GET_CURRENT_TIME : getCurrentTime

  • AD_IS_AD : ad_isAd

  • DEMAND_API_QUERY_ADS : demandApiQueryAds

  • DEMAND_API_FETCH_ADS : demandApiFetchAds

  • SET_HTTP_AGENT : setHttpAgent

BitmovinPlayerState

BitmovinPlayerState: assocarray

Always contains an associative array with values for the possible states of the player

Properties

  • PLAYING : playing

    Indicates that the video is currently playing

  • STALLING : stalling

    Indicates that the video is currently stalling

  • PAUSED : paused

    Indicates that the video is currently paused

  • FINISHED : finished

    Indicates that the video is finished playing

  • ERROR : error

    Indicates that the player is currently stopped due to an error

  • NONE : none

    The state of the player at the moment of component creation

  • SETUP : setup

    Indicates that the player has been successfully setup with the default config or a passed in config

  • READY : ready

    Indicates that the video is ready to be played, but is not currently playing

adBreakFinished

adBreakFinished: assocarray

Signals that an ad break has finished

Properties

  • adBreak

    Information about the adBreak.

adBreakStarted

adBreakStarted: assocarray

Signals that an ad break has started

Properties

  • adBreak

    Information about the adBreak.

adError

adError: assocarray

Is fired when ad playback fails.

adInteraction

adInteraction: assocarray

Is fired when the user interacts with an ad

adQuartile

adQuartile: assocarray

Is fired when the playback of an ad has progressed over a quartile boundary

adFinished

adFinished: assocarray

Is fired when the playback of an ad has been finished

adStarted

adStarted: assocarray

Is fired when the playback of an ad has been started

adSkipped

adSkipped: assocarray

Is fired when an ad has been skipped

audioChanged

audioChanged: assocarray

Signals that the currently selected audio track has changed

currentTime

currentTime: float

Deprecated. Use timeChanged instead. Contains the current time of the video. Contains the time elapsed since playback has started in case of a live stream

downloadFinished

downloadFinished: assocarray

Contains the most recent download

Properties

  • downloadTime

    The time needed to finish the request

  • downloadType

    The type of the request

  • size

    The size of the downloaded data

  • success

    Indicates whether the request was successful (true) or failed (false)

  • url

    The URL of the request

error

error: assocarray

Contains an associative array with the fields code, name and message. Additionally the data field contains all the error fields from the native Roku video node.

Properties

  • code

    Error code of the thrown error.

  • data

    Contains all the error fields from the native Roku video node.

  • message

    Error message containing details about the error.

  • name

    Name of the error that has been thrown.

metadata

metadata: assocarray

Contains the most recent received meta data from the video stream. By default `ID3` and `EMSG` are supported. By enabling the `nativeHlsParsingEnabled` flag in the player config `EXT-X-SCTE35` and `EXT-X-DATERANGE` will be fired as well.

demandApiQueryAdsResult

demandApiQueryAdsResult: assocarray

Contains the result of the Demand API QueryAds() result. To trigger this event use the demandApiQueryAds API call.

demandApiFetchAdsResult

demandApiFetchAdsResult: array

Contains the result of the Demand API FetchAds() result. To trigger this event use the demandApiFetchAds API call.

play

play: boolean

Signals the intention to start/resume playback

playerState

playerState: string

Contains a string value equal to the current state of the player (such as play or pause)

seek

seek: boolean

Always contains the value of true. Will notify the user when seek has been set to true again, to indicate the start of seeking

seeked

seeked: float

Contains a float representing the seeked position in the video and notifies the user when the seek operation has finished

sourceLoaded

sourceLoaded: boolean

Signals that the source has been successfully loaded

sourceUnloaded

sourceUnloaded: boolean

Signals that the source has been successfully unloaded

timeShift

timeShift: float

Contains the intended offset to the live edge and notifies that a timeshift is being made.

timeShifted

timeShifted: float

Contains the actual offset after a timeshift. Notifies that a timeshift has been made.

warning

warning: assocarray

Contains an associative array with the fields code and message

Properties

  • code

    Contains the warning code.

  • message

    Warning message containing details about the warning.

muted

muted: boolean

Signals that the player has been muted

unmuted

unmuted: boolean

Signals that the player has been unmuted

destroy

destroy: assocarray

Is fired when the player instance is destroyed

videoDownloadQualityChanged

videoDownloadQualityChanged: assocarray

Is fired when the downloaded video quality has been changed successfully

Properties

  • sourceQuality

    Previous quality or invalid if no quality was set before

  • targetQuality

    New quality

  • type

    Event type

audioDownloadQualityChanged

audioDownloadQualityChanged: assocarray

Is fired when the downloaded audio quality has been changed successfully

Properties

  • sourceQuality

    Previous quality or invalid if no quality was set before

  • targetQuality

    New quality

  • type

    Event type

impression

impression: assocarray

Is fired when the impression call was sent successfully

Properties

  • domain

    Contains the domain used for the impression request.

  • key

    Contains the license key used for the impression request.

  • platform

    Contains the platform speficied for the impression request.

  • response

    Contains the response of the impression request.

licenseValidated

licenseValidated: assocarray

Is fired when a licensing call succeeded

Properties

  • response

    Contains the response from the license request.

  • responseCode

    Contains the response code from the license request.

timeChanged

timeChanged: assocarray

Contains the current time of the video. Contains the time elapsed since playback has started in case of a live stream

Properties

  • time

    Current timestamp of the video.

subtitleAdded

subtitleAdded: assocarray

Is fired when a new subtitles/captions track was added

subtitleChanged

subtitleChanged: assocarray

Is fired when the current subtitles/captions track was changed

manifestDataParsed

manifestDataParsed: assocarray

Fired for selected HLS tags when encountered while parsing the playlist.

Properties

  • type

    Event type

  • tagName

    The name of the parsed tag (e.g. "EXT-X-KEY")

  • data

    An associative array containing data from the parsed tag. The keys represent the lowercase attributes within that tag.

Methods

setup

  • setup(config: Object)
  • Setup function to give configuration object to player.

    since

    v1.0.0

    Parameters

    • config: Object

      Required config object.

      • playback: Object (optional)

        • autoplay: Boolean (optional) (default: true)

          Determines if videos should play immediately on load

        • muted: Boolean (optional) (default: false)

          Determines if videos should be initially muted

      • adaptation: Object (optional)

        • preload: Boolean (optional) (default: true)

          Determines if, on load, the video should immediately start to buffer

        • adaptiveMinStartBitrate: Integer (optional)

          Minimum startup bitrate specified in kbps. Streaming will start with a variant equal to or greater than this value. If this value is not set or if it's set to zero, any minimum start bitrate will be ignored.

        • adaptiveMaxStartBitrate: Integer (optional)

          Maximum startup bitrate specified in kbps. Streaming will start with a variant less than or equal to this value. If this value is not set, it will default to 2500 kbps.

      • key: Object (optional)

        Bitmovin Player license key

      • source: Object | ContentNode (optional)

        Object containing data pertaining to a specific video source, alternatively, a configured ContentNode could be passed instead.

        • title: String (optional)

          Title of video source

        • dash: String (optional)

          Url to dash video source

        • hls: String (optional)

          Url to hls video source

        • smooth: String (optional)

          Url to smooth video source

        • progressive: String | Object (optional)

          Url to progressive video source. Default type is `mp4`. To use a different type pass a ProgressiveSourceConfig object.

          • url: String (optional)

            Url to progressive video source

          • type: String (optional)

            Type of progressive video source. Valid values can be found in the official Roku documentation.

        • assetType: String (optional)

          Determines if asset is of VOD or LIVE type. If LIVE is not specifially set, VOD type will be used. Can be set to AUTO to automatically detect if the content is live or not (only works for HLS streams)

        • subtitleTracks: Object[] (optional)

          Array of subtitle tracks to side load

          • url: String (optional)

            Url to subtitle track

          • language: String (optional)

            Language for subtitle track

        • drm: Object (optional)

          Object containing data relevant to DRM options

          • widevine: Object (optional)

            Object containing data specific to Widevine DRM

            • LA_URL: String (optional)

          • playready: Object (optional)

            Object containing data specific to Playready DRM

            • LA_URL: String (optional)

            • customData: String (optional)

          • headers: Object (optional)

            An associative array containing the HTTP headers and values to be included in the HTTP request

        • options: Object (optional)

          Source config options

          • startOffset: Integer (optional)

            The position where the stream should be started, the number can be positive or negative depending on the used startOffsetTimelineReference

          • startOffsetTimelineReference: String (optional)

            Timeline reference point to calculate startOffset from, default for live is "end" and for VOD it is "start"

        • advertising: Object (optional)

          The ad configuration used to schedule one or more ad breaks

          • enableAdvertisingDebugOutput: Boolean (optional)

            Specifies if extended RAF (Roku advertising framework) debug output should be enabled or not. Default is false.

          • enableInPodStitching: Boolean (optional)

            When enabled multiple ads within an ad break will be stitched together. Conversely, when In-Pod-Stitching (IPS) is disabled, each video plays individually and a few seconds are spent in a buffering screen between the ads. Default value is `false`.

          • adBreaks: Object[] (optional)

            Collection of ad breaks

            • tag: Object (optional)

              Defines the url and type of the ad manifest

              • url: String (optional)

                Defines the path to an ad manifest. If the tag is a VMAP manifest, the resulting ad breaks will be scheduled as described in the manifest

              • type: String (optional)

                Specifies whether the ad tag is a VAST or VMAP tag

            • id: String (optional)

              Unique identifier of the ad break. Used to be able to identify and discard the ad break dynamically

            • position: String (optional)


              Defines when the ad break shall be started. Default is 'pre'.
              Allowed Values are:
              - 'pre': pre-roll ad
              - 'post': post-roll ad
              - fractional seconds: '10', '12.5' (mid-roll ad)
              - percentage of the entire video duration: '25%', '50%' (mid-roll ad)
              - timecode [hh:mm:ss.mmm]: '00:10:30.000', '01:00:00.000' (mid-roll ad)

          • imaDai: Object (optional)

            IMA DAI configuration object

            • asset: Object (optional)

              Object containing the properties of the asset

              • type: String (optional)

                Determines if asset is VOD or LIVE. Default is VOD.

              • videoId: String (optional)

                Required for on-demand streams. Identifier for the video content source.

              • contentSourceId: String (optional)

                Required for on-demand streams. The content source ID comes from the DFP Video Content Source found in the Google DFP (Ad Manager) UI.

              • assetKey: String (optional)

                Required for live streams. This is used to determine which stream should be played. The live stream request asset key is an identifier which can be found in the Google DFP (Ad Manager) UI.

              • format: String (optional)

                Specifiies the format of the stream. Can either be DASH or HLS. Default is HLS.

            • enableSnapback: Boolean (optional)

              Determines if playback should snap back to seeked over ads. Default is false.

            • apiKey: String (optional)

              Optional. These keys can be used to authenticate stream requests. DAI authentication keys must be set up in the Google DFP (Ad Manager) UI.

        • metadata: Object{} (optional)

          Optional custom metadata represented in string key-value pair

          • title: String (optional)

            Title of video source

          • description: String (optional)

            The description of the video source

          • posterImageUrl: String (optional)

            The video source poster image url

          • genres: String (optional)

            Comma-delimited string. It must be present in order for ad measurements to be enabled

          • childrenContent: String (optional)

            String representation of Boolean value to specify whether content is targeted towards children or not. It must be present in order for ad measurements to be enabled

          • id: String (optional)

            Value representing content to allow potential ad targeting. It must be present in order for ad measurements to be enabled

          • length: String (optional)

            String representation of Integer value representing total length of content (in seconds). It must be present in order for ad measurements to be enabled

        • adaptation: Object{} (optional)

          Used to configure the adaptation logic of the corresponding source.

          • adaptiveMinStartBitrate: Integer (optional)

            Minimum startup bitrate specified in kbps. Streaming will start with a variant equal to or greater than this value. If this value is not set or if it's set to zero, any minimum start bitrate will be ignored.

          • adaptiveMaxStartBitrate: Integer (optional)

            Maximum startup bitrate specified in kbps. Streaming will start with a variant less than or equal to this value. If this value is not set, it will default to 2500 kbps.

      • ui: Boolean (optional) (default: true)

        Determines if the default ui should be enabled

      • thumbnailTrack: Object (optional)

        Thumbnail track

        • url: Object (optional)

          Object containing urls for sd, hd and fhd thumbnail track

          • sd: String (optional)

            Set the url to the standart definition thumbnail track

          • hd: String (optional)

            Set the url to the high definition thumbnail track

          • fhd: String (optional)

            Set the url to the full high definition thumbnail track

      • tweaks: Object (optional)

        • nativeHlsParsingEnabled: Boolean (optional) (default: false)

          If enabled, HLS playlists would be parsed and corresponding events carrying segment-specific metadata, e.g. #EXT-X-SCTE35 tag if present in the manifest, are going to be sent.

        • disableImageMediaPlaylistParsing: Boolean (optional) (default: false)

          If enabled, image media playlist parsing will be disabled

        • useTimedMetadata2: Boolean (optional) (default: false)

          Deprecated. Functionality is enabled by default. If enabled additional metadata from the timedMetadata2 field will be surfaced. Only certain streams contain the metadata sufaced by this field, usually streams with ads stitched in.

        • enableThumbnailTilesDuringLive: Boolean (optional)

          Enables the thumbnailTiles field to be set and updated in the case of live HLS and DASH streams, which contain thumbnails as the thumbnails become available. Default is false.

      • style: Object (optional)

        • adBufferingScreen: Object (optional)

          • background: Object (optional)

            • color: String (optional)

              Valid HEX color code. Default value: #000000

            • visible: Boolean (optional)

              Defines if the background is visible or not. Default value: true

          • bufferingMessage: Object (optional)

            • color: String (optional)

              Valid HEX color code. Default value: #FFCCCCCC

            • text: String (optional)

              Default value: Your program will begin after this message

            • visible: Boolean (optional)

              Defines if the bufferingMessage is visible or not. Default value: true

          • progressBarMessage: Object (optional)

            • color: String (optional)

              Valid HEX color code. Default value: #FFCCCCCC

            • text: String (optional)

              Default value: Loading...

            • visible: Boolean (optional)

              Defines if the progressBarMessage is visible or not. Default value: true

          • progressBarBackground: Object (optional)

            • color: String (optional)

              Valid HEX color code. Default value: #313131

            • visible: Boolean (optional)

              Defines if the progressBarBackground is visible or not. Default value: true

          • progressBarIndicator: Object (optional)

            • color: String (optional)

              Valid HEX color code. Default value: #19B3FF

            • visible: Boolean (optional)

              Defines if the progressBarIndicator is visible or not. Default value: true

          • posterImage: Object (optional)

            • url: String (optional)

              If not set or empty string, "posterImageUrl" value from source config metadata will be used. If "posterImageUrl" value is not set source config poster value will be used

            • visible: Boolean (optional)

              Defines if the posterImage is visible or not. Default value: false

          • title: Object (optional)

            • color: String (optional)

              Valid HEX color code. Default value: #FFCCCCCC

            • text: String (optional)

              If not set or empty string, "title" value from source config metadata will be used. If "title" value of metadata is not set source config title value will be used

            • visible: Boolean (optional)

              Defines if the title is visible or not. Default value: false

          • description: Object (optional)

            • color: String (optional)

              Valid HEX color code. Default value: #FFCCCCCC

            • text: String (optional)

              If not set or empty string, "description" value from source config metadata will be used. If "description" value of metadata is not set source config description will be used

            • visible: Boolean (optional)

              Defines if the description is visible or not. Default value: false

    Returns Void

getConfig

  • getConfig(params: Invalid)
  • Returns the config object of the current player instance.

    since

    v1.4.0

    Parameters

    • params: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Object

getVersion

  • getVersion(params: Invalid)
  • Returns the player version.

    since

    v1.21.0

    Parameters

    • params: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns String

play

  • play(param: Invalid)
  • Function called to play video by setting control on the video node to "play".

    since

    v1.0.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Void

instantReplay

  • instantReplay(param: Invalid)
  • Function called to replay the last couple of seconds of video by setting control on the video node to "replay".

    since

    v1.15.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Void

pause

  • pause(param: Invalid)
  • Function called to play video by setting control on the video node to "pause".

    since

    v1.0.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Void

preload

  • preload(param: Invalid)
  • Function called to play video by setting control on the video node to "prebuffer".

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Void

seek

  • seek(newTime: Integer)
  • Function called to seek to new time, in seconds, on the video node. Also, handles seeking state.

    since

    v1.0.0

    Parameters

    • newTime: Integer

      time to seek to in seconds.

    Returns Void

mute

  • mute(param: Invalid)
  • Function called to mute current video.

    since

    v1.0.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Void

unmute

  • unmute(param: Invalid)
  • Function called to unmute current video.

    since

    v1.0.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Void

captionMode

  • captionMode(ccMode: String)
  • Deprecated. Use setCaptionMode instead.
    Function called to set captions mode on the video node. This effects global settings.
    ccModes: "On", "Off", "Instant Replay", "When Mute (Roku TV Only)"

    since

    v1.0.0

    Parameters

    • ccMode: String

      String to set captions to.

    Returns Void

setCaptionMode

  • setCaptionMode(ccMode: String)
  • Function called to set captions mode on the video node. This effects global settings.
    ccModes: "On", "Off", "Instant Replay", "When Mute" (Roku TV Only)

    since

    v1.25.0

    Parameters

    • ccMode: String

      String to set captions to.

    Returns Void

isMuted

  • isMuted(param: Invalid)
  • Function to get current mute value.

    since

    v1.0.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Boolean

isPlaying

  • isPlaying(param: Invalid)
  • Function to get if player is currently playing

    since

    v1.0.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Boolean

isPaused

  • isPaused(param: Invalid)
  • Function to get if player is currently paused

    since

    v1.0.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Boolean

isStalled

  • isStalled(param: Invalid)
  • Function to get if player is currently buffering, referred to as "stalled" by Bitmovin API.

    since

    v1.0.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Boolean

availableSubtitles

  • availableSubtitles(param: Invalid)
  • Function to get the available subtitles on the current video.

    since

    v1.0.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Array

getSubtitle

  • getSubtitle(param: Invalid)
  • Function gets the current subtitle. If subtitleTrack has not been set by setSubtitle an empty string will be returned. If subtitleTrack has been set to an invalid value, an invalid will be returned.

    since

    v1.0.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Object

setSubtitle

  • setSubtitle(trackID: string)
  • Function to set the subtitle track. trackID must be a valid ID in availableSubtitleTracks.

    since

    v1.0.0

    Parameters

    • trackID: string

      Track ID as defined in availableSubtitleTracks

    Returns Void

setSubtitleStyles

  • setSubtitleStyles(subtitleStyles: Object)
  • Function to set the subtitle styles.
    See https://developer.roku.com/docs/references/scenegraph/media-playback-nodes/video.md#closed-caption-fields for possible key names and values

    since

    v1.10.0

    Parameters

    • subtitleStyles: Object

      The subtitle styles to be applied

    Returns Void

getSubtitleStyles

  • getSubtitleStyles(params: Invalid)
  • Function to get the current subtitle styles.
    See https://developer.roku.com/docs/references/scenegraph/media-playback-nodes/video.md#closed-caption-fields for possible key names and values

    since

    v1.10.0

    Parameters

    • params: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Object

availableAudio

  • availableAudio(param: Invalid)
  • Function to get the available audio on the current video.

    since

    v1.0.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Array

getAudio

  • getAudio(param: Invalid)
  • Function to get the current audio track being played. If there is no audio track and empty string is returned. If the audio track is set to an invalid value, and invalid is returned.

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Object

setAudio

  • setAudio(trackID: string)
  • Function to set audioTrack to the first available track with ID

    Parameters

    • trackID: string

      ID of audio track you wish to switch to. Must exist in availableAudioTracks

    Returns Void

unload

  • unload(param: Invalid)
  • Function to unload video and stop observing fields.

    since

    v1.0.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Void

load

  • load(source: Object | ContentNode)
  • Function to load a source object into the video node, set up player states, and show video on the scene.
    Alternatively, a configured ContentNode could be passed instead.

    since

    v1.0.0

    Parameters

    • source: Object | ContentNode

      Source object, formatted to conform to the Bitmovin API.

      • title: String (optional)

        Title of video source

      • dash: String (optional)

        Url to dash video source

      • hls: String (optional)

        Url to hls video source

      • smooth: String (optional)

        Url to smooth video source

      • progressive: String | Object (optional)

        Url to progressive video source. Default type is `mp4`. To use a different type pass a ProgressiveSourceConfig object.

        • url: String (optional)

          Url to progressive video source

        • type: String (optional)

          Type of progressive video source. Valid values can be found in the official Roku documentation.

      • assetType: String (optional)

        Determines if asset is of VOD or LIVE type. If LIVE is not specifially set, VOD type will be used. Can be set to AUTO to automatically detect if the content is live or not (only works for HLS streams)

      • subtitleTracks: Object[] (optional)

        Array of subtitle tracks to side load

        • url: String (optional)

          Url to subtitle track

        • language: String (optional)

          Language for subtitle track

      • drm: Object (optional)

        Object containing data relevant to DRM options

        • widevine: Object (optional)

          Object containing data specific to Widevine DRM

          • LA_URL: String (optional)

        • playready: Object (optional)

          Object containing data specific to Playready DRM

          • LA_URL: String (optional)

          • customData: String (optional)

        • headers: Object (optional)

          An associative array containing the HTTP headers and values to be included in the HTTP request

      • options: String (optional)

        Source config options

        • startOffset: String (optional)

          The position where the stream should be started, the number can be positive or negative depending on the used startOffsetTimelineReference

        • startOffsetTimelineReference: String (optional)

          Timeline reference point to calculate startOffset from, default for live is "end" and for VOD it is "start"

      • advertising: Object (optional)

        The ad configuration used to schedule one or more ad breaks

        • enableAdvertisingDebugOutput: Boolean (optional)

          Specifies if extended RAF (Roku advertising framework) debug output should be enabled or not. Default is false.

        • enableInPodStitching: Boolean (optional)

          When enabled multiple ads within an ad break will be stitched together. Conversely, when In-Pod-Stitching (IPS) is disabled, each video plays individually and a few seconds are spent in a buffering screen between the ads. Default value is `false`.

        • adBreaks: Object[] (optional)

          Collection of ad breaks

          • tag: Object (optional)

            Defines the url and type of the ad manifest

            • url: String (optional)

              Defines the path to an ad manifest. If the tag is a VMAP manifest, the resulting ad breaks will be scheduled as described in the manifest

            • type: String (optional)

              Specifies whether the ad tag is a VAST or VMAP tag

          • id: String (optional)

            Unique identifier of the ad break. Used to be able to identify and discard the ad break dynamically

          • position: String (optional)


            Defines when the ad break shall be started. Default is 'pre'.
            Allowed Values are:
            - 'pre': pre-roll ad
            - 'post': post-roll ad
            - fractional seconds: '10', '12.5' (mid-roll ad)
            - percentage of the entire video duration: '25%', '50%' (mid-roll ad)
            - timecode [hh:mm:ss.mmm]: '00:10:30.000', '01:00:00.000' (mid-roll ad)

        • imaDai: Object (optional)

          IMA DAI configuration object

          • asset: Object (optional)

            Object containing the properties of the asset

            • type: String (optional)

              Determines if asset is VOD or LIVE. Default is VOD.

            • videoId: String (optional)

              Required for on-demand streams. Identifier for the video content source.

            • contentSourceId: String (optional)

              Required for on-demand streams. The content source ID comes from the DFP Video Content Source found in the Google DFP (Ad Manager) UI.

            • assetKey: String (optional)

              Required for live streams. This is used to determine which stream should be played. The live stream request asset key is an identifier which can be found in the Google DFP (Ad Manager) UI.

            • format: String (optional)

              Specifiies the format of the stream. Can either be DASH or HLS. Default is HLS.

          • enableSnapback: Boolean (optional)

            Determines if playback should snap back to seeked over ads. Default is false.

          • apiKey: String (optional)

            Optional. These keys can be used to authenticate stream requests. DAI authentication keys must be set up in the Google DFP (Ad Manager) UI.

      • metadata: Object{} (optional)

        Optional custom metadata represented in string key-value pair

        • title: String (optional)

          Title of video source

        • description: String (optional)

          The description of the video source

        • posterImageUrl: String (optional)

          The video source poster image url

        • genres: String (optional)

          Comma-delimited string. It must be present in order for ad measurements to be enabled

        • childrenContent: String (optional)

          String representation of Boolean value to specify whether content is targeted towards children or not. It must be present in order for ad measurements to be enabled

        • id: String (optional)

          Value representing content to allow potential ad targeting. It must be present in order for ad measurements to be enabled

        • length: String (optional)

          String representation of Integer value representing total length of content (in seconds). It must be present in order for ad measurements to be enabled

      • adaptation: Object{} (optional)

        Used to configure the adaptation logic of the corresponding source.

        • adaptiveMinStartBitrate: Integer (optional)

          Minimum startup bitrate specified in kbps. Streaming will start with a variant equal to or greater than this value. If this value is not set or if it's set to zero, any minimum start bitrate will be ignored.

        • adaptiveMaxStartBitrate: Integer (optional)

          Maximum startup bitrate specified in kbps. Streaming will start with a variant less than or equal to this value. If this value is not set, it will default to 2500 kbps.

    Returns Void

getDuration

  • getDuration(params: Invalid)
  • Returns the duration of the video node for a VOD. Returns -1 in case of a live stream
    The duration of the video being played, specified in seconds. This becomes valid when playback begins and may change if the video is dynamic content, such as a live event.

    since

    v1.6.0

    Parameters

    • params: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns float

timeShift

  • timeShift(offset: float)
  • Function to shift the time to a given offset. Has to be within getMaxTimeShift() (which is a negative value) and 0. Only works with live streams and only after playback has started, otherwise it will result in a no-op.

    since

    v1.3.0

    Parameters

    • offset: float

      offset

    Returns Void

getTimeShift

  • getTimeShift(params: Invalid)
  • Returns the current time shift offset to the live edge in seconds. Only applicable to live streams.

    since

    v1.3.0

    Parameters

    • params: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns float

getMaxTimeShift

  • getMaxTimeShift(params: Invalid)
  • Returns the limit in seconds for time shift. Is either negative or 0 and applicable to live streams only.

    since

    v1.3.0

    Parameters

    • params: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns float

isLive

  • isLive(params: Invalid)
  • Return true if the displayed video is a live stream.

    since

    v1.3.0

    Parameters

    • params: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Boolean

setHttpHeaders

  • setHttpHeaders(headers: Dynamic)
  • Deprecated - use setHttpAgent instead. Function to set http header on the video node.

    since

    v1.7.0

    Parameters

    • headers: Dynamic

      headers

    Returns Void

getThumbnail

  • getThumbnail(time: FloatmaxThumbnailDimension: Object)
  • Returns a thumbnail image for a certain time or invalid if there is no thumbnail available.
    Requires a configured thumbnails track in SourceConfig.thumbnailTrack.

    since

    v1.14.0

    Parameters

    • time: Float

      the media time in seconds for which the thumbnail should be returned

    • maxThumbnailDimension: Object

      the maximum dimensions of the thumbnail

      • width: Integer (optional)

        the maximum width of the thumbnail

      • height: Integer (optional)

        the maximum height of the thumbnail

    Returns Object

ad_schedule

  • ad_schedule(advertising: Object)
  • Schedules resulting ad break(s) of an ad config for playback.

    since

    v1.24.0

    Parameters

    • advertising: Object

      The ad configuration used to schedule one or more ad breaks

      • enableAdvertisingDebugOutput: Boolean (optional)

        Specifies if extended RAF (Roku advertising framework) debug output should be enabled or not. Default is false.

      • adBreaks: Object[] (optional)

        Collection of ad breaks

        • tag: Object (optional)

          Defines the url and type of the ad manifest

          • url: String (optional)

            Defines the path to an ad manifest. If the tag is a VMAP manifest, the resulting ad breaks will be scheduled as described in the manifest

          • type: String (optional)

            Specifies whether the ad tag is a VAST or VMAP tag

        • id: String (optional)

          Unique identifier of the ad break. Used to be able to identify and discard the ad break dynamically

        • position: String (optional)


          Defines when the ad break shall be started. Default is 'pre'.
          Allowed Values are:
          - 'pre': pre-roll ad
          - 'post': post-roll ad
          - fractional seconds: '10', '12.5' (mid-roll ad)
          - percentage of the entire video duration: '25%', '50%' (mid-roll ad)
          - timecode [hh:mm:ss.mmm]: '00:10:30.000', '01:00:00.000' (mid-roll ad)

    Returns Void

ad_list

  • ad_list(param: Invalid)
  • Returns all scheduled ad breaks.

    since

    v1.24.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Array

ad_getActiveAdBreak

  • ad_getActiveAdBreak(param: Invalid)
  • Returns the currently active ad break. If no ad is active returns invalid.

    since

    v1.24.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Array

ad_discardAdBreak

  • ad_discardAdBreak(adBreakId: Object)
  • Discards all scheduled ad breaks with the given ID.

    since

    v1.24.0

    Parameters

    • adBreakId: Object

      The ID of the ad break which shall be removed from the scheduled ad breaks.

    Returns Void

destroy

  • destroy(param: Invalid)
  • Is fired when the player instance is destroyed.

    since

    v1.25.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns Void

getCurrentTime

  • getCurrentTime(param: Invalid)
  • Returns the current playback time of the video in seconds.

    since

    v1.40.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns number

ad_isAd

  • ad_isAd(param: Invalid)
  • Returns true while an ad is played back, false otherwise.

    since

    v1.41.0

    Parameters

    • param: Invalid

      invalid param, unused but due to nature, required to be passed in.

    Returns boolean

demandApiQueryAds

  • demandApiQueryAds(criteria: Object)
  • Queries a list of ads based on the given criteria. Given criteria may consist of user, device and content values along with other values specified by the publisher. The resulting list of ads can be retrieved via the `demandApiQueryAdsResult` callback once available.

    since

    v1.57.0

    Parameters

    • criteria: Object

      DemandApi configuration criteria, for more details about each parameter of the criteria object please refer to the Demand API documentation provided by Roku.

    Returns Void

demandApiFetchAds

  • demandApiFetchAds(ads: Object)
  • Calls the FetchAds function on the Roku Demand API, the result can be found on the field demandApiFetchAdsResults once the request has been made.

    since

    v1.58.0

    Parameters

    • ads: Object

      The list of ad creative URLs to be parsed and rendered. The list includes the ads selected from the set returned by the demandApiQueryAds method

    Returns Void

setHttpAgent

  • setHttpAgent(httpAgentConfiguration: Object)
  • Updates the roHttpAgent object on the video node.
    Type "generic" applies the given roHttpAgent to all requests, while type "drm" only applies (and supersedes) for DRM related requests. Default is "generic".

    since

    v1.72.0

    Parameters

    • httpAgentConfiguration: Object

      Object that specifies which and what type of HttpAgent should be set.

      • httpAgent: Object (optional)

        The roHttpAgent to be set on the video node.

      • agentType: String (optional)

        Determines the type of HTTP Agent. Can be either "generic" or "drm".

    Returns Void

Errors

UNKNOWN

UNKNOWN: 1000

Error is unknown. Error can be thrown in cases where Bitmovin Player can’t recognise the error. The most common cause for this error is configuring dash, hls, progressive or smooth properties with the non-corresponding stream format like using dash stream for the hls property. For further troubleshooting please check the data property of the error event.

SETUP_LICENSE_ERROR

SETUP_LICENSE_ERROR: 1103

The license is not valid. The player license server did not grant playback for the given player key as specified in the player config. The most common cause for this error is an incorrect or non-existing player key was specified in the player config.

SOURCE_INVALID

SOURCE_INVALID: 1201

No valid source was provided. Common causes for this error is that source config object didn't contain dash, hls, progressive or smooth properties.

PLAYBACK_ERROR

PLAYBACK_ERROR: 1300

General playback error. The most common cause for this error is configuring dash, hls, progressive or smooth properties with the stream format not supported by the Roku platform.

NETWORK_ERROR

NETWORK_ERROR: 1400

Network error while downloading. There was an error in the HTTP response. This could mean malformated HTTP header or error code was returned. The most common causes for this error includes: Malformed URL of dash, hls, progressive or smooth properties and trying to playback the content with the two different instances of the player at the same time.

DRM_ERROR

DRM_ERROR: 2000

General DRM error. Error can be thrown in cases where DRM for the stream is not properly configured in the source config or if there are any issues with the DRM on the server side. Please verify that license and/or server certificate URLs are correct, and that the server certificate specified in the DRM config is valid, if one was specified. In order to get more information about the specific DRM error, please check the data property of the error event.

Generated using TypeDoc