Initialization
This section describes how to run OvenPlayer and explains various configuration options. Also, it includes a way to access an OvenPlayer instance.
Last updated
This section describes how to run OvenPlayer and explains various configuration options. Also, it includes a way to access an OvenPlayer instance.
Last updated
You need to obtain the OvenPlayer Instance to use the OvenPlayer API. You can typically use the OvenPlayer Instance returned after OvenPlayer.create()
. However, we will inform you of some ways to access the OvenPlayer Instance in debugging or unexpected situations.
Params | Type | Memo |
---|---|---|
You run the player with the DOM Element and Options with ID. It returns the Instance of the player.
You set up to show all logs that occur in the OvenPlayer that is on the web page.
You can use the following options to initialize the player:
You can set the aspect ratio of the player to match the aspect ratio of the video playing. Any aspect ratio can be set such as "21: 9", "4: 3", "1: 1".
You can display a title.
You can set the watermark image on the player. See the following for detailed settings.
Sets the URL of the watermark image.
Sets the text of the watermark.
Sets the font style of the watermark text. All Font CSS key-value available (e.g. font-size
, font-weight
, color
...)
Sets the location where the watermark is placed. top-right
, top-left
, bottom-right
, bottom-left
are available.
waterMark.y
Sets the distance from the top or bottom specified by waterMark.position
. All CSS value available (e.g. 10px
, 5%
, 1rem
...)
waterMark.x
Sets the distance from the left or right specified by waterMark.position
. All CSS value available (e.g. 10px
, 5%
, 1rem
...)
waterMark.width
Sets the width of the watermark image. The default value auto
means set to the original width of the image. All CSS value available (e.g. 10px
, 5%
, 1rem
...)
waterMark.height
Sets the height of the watermark image. The default value auto
means set to the original height of the image. All CSS value available (e.g. 10px
, 5%
, 1rem
...)
waterMark.opacity
Sets the URL of the watermark image.
You can choose whether to play OvenPlayer automatically when the source is loaded. However, depending on the Browser Policy, it may restrict autoplay at any time.
If set to true, if playback fails when multiple playback sources are set, the playback source set to the next will be played automatically.
If you don't want to show the control bar on OvenPlayer, change this option to false.
You can play a video repeatedly using this option.
You can choose whether to show or hide the big play button.
You can disable users to seek using a progress bar or keyboard interaction.
You can choose whether to show or hide the quick seek buttons.
You can set seek interval of the quickly seek button.
You can enable users to enter or exit the full screen with double click the player.
You can use fake full screen ui (Make player full size on screen) on iOS.
If you set this option to true, it will run in mute mode.
You set whether to display time or frame information in the control bar on OvenPlayer. Of course, framerate information is required when registering sources to display the correct frame information.
You can set the playback speed with this option.
You can set the range of video playback speed. The playback speed range is 0.25 to 4x.
It 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.)
You can register the URL of the content playback URL as shown below:
If you have multiple protocols or multiple resolutions for a single content, you can register them at once using sources
. Also, multiple protocols can support a broader range of browsers, and multiple resolutions allow viewers to select video quality.
OvenPlayer will play a video in the order of the protocol or resolution you entered in sources
and will automatically play the next source if playback fails.
You can register the URL information of the subtitle file shown with a video. OvenPlayer supports *.vtt
, *.srt
, and *.smi
as subtitle file formats.
You can cut the playback before the time of sectionStart
and cuts the playback after the time of sectionEnd
. The example below will only play between 300 seconds to 600 seconds of the stream.
You can prevent the use of some browser's native HLS capabilities by setting the flag overrideNative
to the video source. This forces the use of Media Source Extensions to provide a more consistent experience between browsers.
You can set the initial volume when a user plays a video in OvenPlayer.
You can set the URL of the Video Ad Serving Template (VAST) to play in OvenPlayer. Also, OvenPlayer supports VAST 4, VAST 3, VAST 2, VPAID 2 (HTML 5), and VMAP 1.0.1.
For more information, see Support and Compatibility.
Sets whether to Google IMA or Simple VAST the Ads client when player initialize. "googleima" or "vast".
You can set the URL of a poster image / thumbnail. The image file is displayed prior to the player showing the first frames of the video.
playlist
has multiple sources
mentioned above. You can explore between playlists, and it automatically plays the next content. Also, you can assign ads and captions for each playlist
.
You can set whether to show or hide the playlist button when the playlist is initialized.
When playing WebRTC, you can set WebRTC specific configurations.
Set the timeout from the start of signaling until it is connected with OvenMediaEngine. connectionTimeout
sets the maximum allowable time until a connection is established. timeoutMaxRetry
sets the number of times the player will automatically retry the connection when the maximum allowed time has elapsed. When retrying a connection due to a timeout, the player does not display an error message. If the connection fails after retries for timeoutMaxRetry
, the player throws a timeout error. If timeoutMaxRetry
is set to 0, no timeout processing is performed.
Set the play out delay hint for WebRTC playback. If the browser supports it, the initial playback will be delayed by the set value.
You can set a list of STUN or TURN servers.
You can ice transport policy, which can limit the transport policies of the ICE candidates to be considered during the connection process.
When playing HLS, you can set hls.js detailed tuning options (https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning).
When playing DASH, you can set configuration(https://cdn.dashjs.org/latest/jsdoc/module-Settings.html) parameters of Dash.js MediaPlayer.
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
pe | Default | Required |
---|---|---|
pe | Default | Required |
---|---|---|
pe | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
Type | Default | Required |
---|---|---|
container
String | HTMLElement
DOM Element
options
Object
Please see the Options section below.
String
'16:9'
false
String
null
false
String
null
true
String
null
true
Object
null
false
String
'top-right'
false
String
5%
false
String
2.8%
false
String
auto
false
String
auto
false
Number
0.7
false
boolean
false
false
Type
Default
Required
boolean
True
false
Type
Default
Required
boolean
true
false
boolean
false
false
boolean
true
false
boolean
false
false
boolean
false
false
Number
10
false
boolean
false
false
boolean
false
false
boolean
false
false
boolean
true
false
Number
1
false
Array of Number
[2, 1.5, 1, 0.5, 0.25]
false
Boolean
false
false
Object | Array of Object
-
true
Type
Default
Required
Array of Object
-
false
Type
Default
Required
Number
100
false
Type
Default
Required
String
-
false
Type
Default
Required
String
"googleima"
false
Type
Default
Required
String
-
false
Type
Default
Required
Array of Object
-
false
Field
Type
Default
Required
title
String
sources[0].label
false
image
String
-
false
duration
Number
-
false
adTagUrl
String
-
false
sources
Object | Array of Object
-
true
tracks
Array of Object
-
false
Type
Default
Required
boolean
false
false
Type
Default
Required
timeoutMaxRetry
Number
0
false
connectionTimeout
Number
10000
false
Number
null
false
Type
Default
Required
Object
null
false
Type
Default
Required
Object
null
false
iceTransportPolicy
Description
"all"
All ICE candidates will be considered.
"public"
Only ICE candidates with public IP addresses will be considered. Removed from the specification's May 13, 2016 working draft.
"relay"
Only ICE candidates whose IP addresses are being relayed, such as those passed through a TURN server, will be considered.
Type
Default
Required
Object
null
false
Type
Default
Required
Object
null
false