You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specifies how long to buffer messages before starting to display the stream.
(*optional when using rtmp protocol.)
rtmpBufferTimeMax
type
default
Number
3
Specifies a maximum buffer length for live streaming content, in seconds.
(*optional when using rtmp protocol.)
lowLatencyMpdLiveDelay
type
default
Number
null
Lowering this value will lower latency but may decrease the player's ability to build a stable buffer.
(*optional when using low latancy mpeg dash protocol.)
webrtcConfig.iceServers
type
default
Object
null
Specifies STUN / TURN server
(*optional when using WebRTC protocol.)
webrtcConfig.iceTransportPolicy
type
default
String
null
Specifies Ice Transport Policy. "all", "public", "relay"
(*optional when using WebRTC protocol.)
currentProtocolOnly
type
default
Boolean
false
Shows only current protocols.
(*If you want to show only quality information when there are various protocols and various quality information together, please use it.)
adClient
type
default
String
"googleima"
Sets whether to Google IMA or Simple VAST the Ads client when player initialize. "googleima" or "vast"
lang
type
default
String
"en"
Sets the language to be displayed. The player is built in English and Korean.
systemText
Sets the custom language to be displayed.
player = OvenPlayer.create("player",
{
sources : newUrls,
systemText : {
"lang" : "cn",
"ui" : {
"context" : "关于OvenPlayer",
"controls" : {
"live" : "直播",
"low_latency_live" : "低延迟直播",
"low_latency_p2p" : "低延迟实时p2p",
},
"playlist" : "播放列表",
"setting" : {
"title" : "设置",
"speed" : "Speed",
"source" : "Source",
"quality" : "Quality",
"caption" : "Caption",
"display" : "Display"
}
},
"api" : {
"message" : {
"muted_play" : "Please touch here to turn on the sound."
},
"error": {
100: {
"code": 100,
"message": "Can not load due to unknown reasons.",
"reason": "Can not load due to unknown reasons."
},
101: {
"code": 101,
"message": "Can not load due to unsupported media.",
"reason": "Can not load due to unsupported media."
},
102: {
"code": 102,
"message": "Flash fetching process aborted. </br><a href='http://www.adobe.com/go/getflashplayer' target='_self'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player'></a>",
"reason": "It looks like not found swf or your environment is localhost."
},
103: {
"code": 103,
"message": "Can not load due to dashjs. Please check the lastest version.",
"reason": "dash.js version is old. Please check the lastest."
},
104: {
"code": 104,
"message": "Can not load due to google ima for Ads. ",
"reason": "Please check the google ima library."
},
105: {
"code": 105,
"message": "Can not find the dashjs. Please check the dashjs.",
"reason": "Not found dashjs."
},
106: {
"code": 106,
"message": "Can not find the hlsjs. Please check the hlsjs.",
"reason": "Not found hlsjs."
},
300: {
"code": 300,
"message": "Can not play due to unknown reasons.",
"reason": "Can not play due to unknown reasons."
},
301: {
"code": 301,
"message": "Fetching process aborted by user.",
"reason": "Fetching process aborted by user."
},
302: {
"code": 302,
"message": "Some of the media could not be downloaded due to a network error.",
"reason": "Error occurred when downloading."
},
303: {
"code": 303,
"message": "Unable to load media. This may be due to a server or network error, or due to an unsupported format.",
"reason": "Error occurred when decoding."
},
304: {
"code": 304,
"message": "Media playback has been canceled. It looks like your media is corrupted or your browser does not support the features your media uses.",
"reason": "Media playback not supported."
},
305: {
"code": 305,
"message": "Can not load captions due to unknown reasons.",
"reason": "Can not load captions due to unknown reasons."
},
501: {
"code": 501,
"message": "Connection with low-latency(OME) server failed.",
"reason": "WebSocket connection failed."
},
502: {
"code": 502,
"message": "Connection with low-latency(OME) server failed.",
"reason": "WebRTC addIceCandidate failed."
},
503: {
"code": 503,
"message": "Connection with low-latency(OME) server failed.",
"reason": "WebRTC setRemoteDescription failed."
},
504: {
"code": 504,
"message": "Connection with low-latency(OME) server failed.",
"reason": "WebRTC peer createOffer failed."
},
505: {
"code": 505,
"message": "Connection with low-latency(OME) server failed.",
"reason": "WebRTC setLocalDescription failed."
},
510: {
"code": 510,
"message": "Network connection is unstable. Check the network connection.",
"reason": "Network is slow."
}
}
}
}
});
Static Methods
player = OvenPlayer.create(container, options)
Create a player instance.
Type
Memo
container
String
DOMElement
options
Object
player
OvenPlayerInstance
players = OvenPlayer.getPlayerList()
Returns all created player instances.
Type
Memo
players
Array.<OvenPlayerInstance>
player = OvenPlayer.getPlayerByContainerId(containerId)
Returns the player instance that matches the containerId.
The new player size. large(>992), medium(<992), small(<768), xsmall(<576).
player.on('play')
Fired when the player enters the playing state.
Attribute
Type
Memo
prevState
String
The state the player moved from.
player.on('pause')
Fired when the player enters the paused state.
Attribute
Type
Memo
prevState
String
The state the player moved from.
player.on('complete')
Fired when an item completes playback.
player.on('playbackRateChanged')
Fired when the playback rate has been changed.
Attribute
Type
Memo
playbackRate
Number
The new playback rate
player.on('seek')
Fired after a seek has been requested either by scrubbing the control bar or through the API.
Attribute
Type
Memo
position
Number
The position of the player before the player seeks (in seconds).
offset
Number
The position that has been requested to seek to (in seconds).
player.on('seeked')
Triggered when video position changes after seeking, as opposed to on('seek') which triggers as a seek occurs.
player.on('time')
While the player is playing, this event is fired as the playback position gets updated. This may occur as frequently as 10 times per second.
Attribute
Type
Memo
duration
Number
Duration of the current playlist item in seconds.
position
Number
Playback position in seconds.
player.on('mute')
Triggered when the player has gone in or out of a mute state.
Attribute
Type
Memo
mute
Boolean
The player's new mute state
player.on('volumeChanged')
Triggered when the player's volume is changed.
Attribute
Type
Memo
volume
Number
New volume percentage (0-100)
player.on('playlistChanged')
Fired when the active playlist is changed. Happens in response to e.g. a user clicking an option in the playlist menu or a script calling setCurrentPlaylist or prev playlist has been completed.
Attribute
Type
Memo
``
Number
index of the new playlist index
player.on('sourceChanged')
Fired when the active source(protocol) is changed. Happens in response to e.g. a user clicking an option in the source menu or a script calling setCurrentSource.
Attribute
Type
Memo
currentSource
Number
index of the new quality level in the getSources() array
player.on('qualityChanged')
Fired when the active quality level is changed. Happens in response to e.g. a user clicking an option in the quality menu or a script calling setCurrentQuality.
Attribute
Type
Memo
currentQuality
Number
index of the new quality level in the getQualityLevels() array
type
String
"request" : Triggered when user sets quality level., "render" : Streaming rendered.
isAuto
Boolean
The player's auto switching quality state.
player.on('cueChanged')
Fired when VTTCue is changed.
Attribute
Type
Memo
VTTVcue
Object
VTTCue Object
player.on('timeDisplayModeChanged')
Fired when timecode mode is changed.
Attribute
Type
Memo
isTimecodeDisplaying
boolean
changed displaying mode
player.on('adChanged')
Fired when Ad is changed.
Attribute
Type
Memo
isLinear
Boolean
True if the ad is linear, false otherwise.
duration
Number
Returns the duration of the selected creative, or -1 for non-linear creatives.
skipTimeOffset
Number
The number of seconds of playback before the ad becomes skippable.
player.on('adTime')
Fired when Ad is playing.
Attribute
Type
Memo
isLinear
Boolean
True if the ad is linear, false otherwise.
duration
Number
Returns the duration of the selected creative, or -1 for non-linear creatives.
skipTimeOffset
Number
The number of seconds of playback before the ad becomes skippable.
remaining
Number
Get the remaining time of the current ad that is playing.
position
Number
Playback position in seconds.
player.on('adComplete')
Fired when Ad is complete.
Attribute
Type
Memo
player.on('fullscreenChanged')
Fired when screen mode is changed.
Type
Memo
Boolean
True if the screen is full, false otherwise.
player.on('clicked')
Triggered when the player is clicked.
If ad clicked, this returns {type : "adclick"}.