Skip to main content

API

API Reference

getVersion()

playerInstance.getVersion()

This command returns OvenPlayer version information.

getConfig()

playerInstance.getConfig()

This command returns the configured option value when OvenPlayer is initialized.

TypeMemo
null

load()

playerInstance.load(playlist)

This command initializes OvenPlayer with a new playlist.

TypeMemo
Arrayplaylist or sources
playlist = [
{
title : "01",
adTagUrl : "https://pubads.g.doubleclick.net/gampad/ads?...",
image : "https://path.to/your_video_thumbnail.jpeg",
duration : 7343,
sources: [ {
type : "mp4",
file : "https://path.to/your_video",
label : "360P"
}],
tracks: [{
kind : "captions",
file : "https://path.to/your_caption.vtt",
label : "KO vtt"
}]
},
{
title : "02",
adTagUrl : "https://pubads.g.doubleclick.net/gampad/ads?...",
image : "https://path.to/your_video_thumbnail2.jpeg",
duration : 8333,
sources: [ {
type : "mp4",
file : "https://path.to/your_video2",
label : "360P"
},
{
type : "mpd",
file : "https://path.to/your_video.mpd",
label: "360P DASH"
}
tracks: [{
kind : "captions",
file : "https://path.to/your_caption2.vtt",
label : "KO vtt"
}]
}
];

or

sources = [
{
type : "mp4",
file : "https://path.to/your_video",
framerate : 30,
label : "360P"
},
{
type : "mp4",
file : "https://path.to/your_video",
framerate : 30,
label: "480P"
},

{
type : "mp4",
file : "https://path.to/your_video",
framerate : 30,
label : "720p",
default : "true"
}
];

getMediaElement()

const videoElement = playerInstance.getMediaElement()
TypeMemo
HTML Video Element<video></video>

getState()

playerInstance.getState()

This command gets information about what OvenPlayer is currently doing.

TypeMemo
null

getBrowser()

playerInstance.getBrowser()

This command returns the analyzed information from the user agent. However, this information is not necessarily correct because the user agent can hide or misleading information.

TypeMemo
null

setTimecodeMode()

playerInstance.setTimecodeMode(isShow)

You can use this command to set whether the time-code or frame-code is displayed in the OvenPlayer control bar. However, if you want to use frame-code, the source must contain frame rate information.

TypeMemo
Boolean

isTimecodeMode()

playerInstance.isTimecodeMode()

This command checks whether OvenPlayer is currently running in time-code or frame-code.

TypeMemo
null

getFramerate()

playerInstance.getFramerate()

This command gets the frame-rate value of playing video. However, if you want to see frame-rate, the source or playlist must have information about frame-rate.

TypeMemo
null

seekFrame()

playerInstance.seekFrame(frameCount)

This command moves the playback to frameCount.

TypeMemo
NumberframeCount to move

getDuration()

playerInstance.getDuration()

This command gets the duration of the content.

TypeMemo
null

getPosition()

playerInstance.getPosition()

This command gets the current playing time of content.

TypeMemo
null

getVolume()

playerInstance.getVolume()

This command gets the volume value set in OvenPlayer.

TypeMemo
null

setVolume()

playerInstance.setVolume(volume)

You can use this command to control volume in OvenPlayer.

TypeMemo
Number0 &#126; 100

getMute()

playerInstance.getMute()

This command gets if OvenPlayer is currently muted (or volume: 0).

TypeMemo
null

setMute()

playerInstance.setMute(isMute)

You can use this command to set mute.

TypeMemo
Boolean

play()

playerInstance.play()

This command plays OvenPlayer.

If OvenPlayer is not ready to play, OvenPlayer will wait until it is prepared and then play.

TypeMemo
null

pause()

playerInstance.pause()

This command pauses the playing content.

TypeMemo
null

seek()

playerInstance.seek(position)

This command moves the playback to a position.

TypeMemo
NumberSeconds

getPlaybackRate()

playerInstance.getPlaybackRate()

This command gets the playback speed information of content.

TypeMemo
null

setPlaybackRate()

playerInstance.setPlaybackRate(playbackRate)

You can use this command to adjust the playback speed in OvenPlayer.

TypeMemo
NumberPlayback speed to change

getPlaylist()

playerInstance.getPlaylist()

This command gets a registered playlist.

TypeMemo
null

getCurrentPlaylist()

playerInstance.getCurrentPlaylist()

This command gets the index information of the playlist currently playing.

TypeMemo
null

setCurrentPlaylist()

playerInstance.setCurrentPlaylist(playlistIndex)

This command changes the playlist currently playing.

TypeMemo
Number

getSources()

playerInstance.getSources()

This command gets information about sources from the playlist or sources of a single content currently playing.

TypeMemo
null

getCurrentSource()

playerInstance.getCurrentSource()

This command gets the index information of the currently playing source.

TypeMemo
null

setCurrentSource()

playerInstance.setCurrentSource(index)

This command changes the source of the playing content. It depends on your settings, but the protocol and video quality (resolution) will change by default.

TypeMemo
Number

getQualityLevels()

playerInstance.getQualityLevels()

This command gets a list of resolutions if the metadata in the playing content contains quality information. And it is available when using the MPEG-DASH protocol.

TypeMemo
null

getCurrentQuality()

playerInstance.getCurrentQuality()

This command gets the index of the current video quality information.

TypeMemo
null

setCurrentQuality()

playerInstance.setCurrentQuality(index)

You can use this command to set to play as index quality.

TypeMemo
Number

isAutoQuality()

playerInstance.isAutoQuality()

This command checks whether the video quality has been set to change automatically based on internet status, condition, and more.

TypeMemo
null

setAutoQuality()

playerInstance.setAutoQuality(isAuto)

You can use this command to set whether to change the video quality automatically.

TypeMemo
Boolean

getCaptionList()

playerInstance.getCaptionList()

It reads the list of registered subtitles in the current playlist.

TypeMemo
null

getCurrentCaption()

playerInstance.getCurrentCaption()

This command gets the index of the using subtitle in the current playlist.

TypeMemo
null

setCurrentCaption()

playerInstance.setCurrentCaption(index)

You can use this command to set the subtitle of the current playlist to the caption of the index.

TypeMemo
Number

addCaption()

playerInstance.addCaption(track)

You can use this command to add subtitles to the current playlist.

TypeMemo
Object
{
kind: "captions",
file: captionUrl,
label: "KO vtt"
}

removeCaption()

playerInstance.removeCaption(index)

You can use this command to remove the subtitle corresponding to the index from the current playlist.

TypeMemo
Number

stop()

playerInstance.stop()

This command stops playing and moves the playback position to 0.

TypeMemo
null

showControls()

playerInstance.showControls(show)

This API can show or hide the player's control area.

TypeMemo
Booleanset true or false to show or hide controls

remove()

playerInstance.remove()

This command removes the player and releases all resources.

Architectures