API
This chapter lists information about the OvenPlayer API, which you can control with OvenPlayerInstance.
API Reference
getVersion()
This command returns OvenPlayer version information.
getConfig()
This command returns the configured option value when OvenPlayer is initialized.
null
load()
This command initializes OvenPlayer with a new playlist.
Array
playlist or sources
getMediaElement()
HTML Video Element
<video></video>
getState()
This command gets information about what OvenPlayer is currently doing.
null
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.
null
setTimecodeMode()
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.
Boolean
isTimecodeMode()
This command checks whether OvenPlayer is currently running in time-code or frame-code.
null
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.
null
seekFrame()
This command moves the playback to frameCount.
Number
frameCount to move
getDuration()
This command gets the duration of the content.
null
getPosition()
This command gets the current playing time of content.
null
getVolume()
This command gets the volume value set in OvenPlayer.
null
setVolume()
You can use this command to control volume in OvenPlayer.
Number
0 ~ 100
getMute()
This command gets if OvenPlayer is currently muted (or volume: 0).
null
setMute()
You can use this command to set mute.
Boolean
play()
This command plays OvenPlayer.
If OvenPlayer is not ready to play, OvenPlayer will wait until it is prepared and then play.
null
pause()
This command pauses the playing content.
null
seek()
This command moves the playback to a position.
Number
Seconds
getPlaybackRate()
This command gets the playback speed information of content.
null
setPlaybackRate()
You can use this command to adjust the playback speed in OvenPlayer.
Number
Playback speed to change
getPlaylist()
This command gets a registered playlist.
null
getCurrentPlaylist()
This command gets the index information of the playlist currently playing.
null
setCurrentPlaylist()
This command changes the playlist currently playing.
Number
getSources()
This command gets information about sources from the playlist or sources of a single content currently playing.
null
getCurrentSource()
This command gets the index information of the currently playing source.
null
setCurrentSource()
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.
Number
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.
null
getCurrentQuality()
This command gets the index of the current video quality information.
null
setCurrentQuality()
You can use this command to set to play as index quality.
Number
isAutoQuality()
This command checks whether the video quality has been set to change automatically based on internet status, condition, and more.
null
setAutoQuality()
You can use this command to set whether to change the video quality automatically.
Boolean
getCaptionList()
It reads the list of registered subtitles in the current playlist.
null
getCurrentCaption()
This command gets the index of the using subtitle in the current playlist.
null
setCurrentCaption()
You can use this command to set the subtitle of the current playlist to the caption of the index.
Number
addCaption()
You can use this command to add subtitles to the current playlist.
Object
removeCaption()
You can use this command to remove the subtitle corresponding to the index from the current playlist.
Number
stop()
This command stops playing and moves the playback position to 0.
null
showControls()
This API can show or hide the player's control area.
Boolean
set true or false to show or hide controls
remove()
This command removes the player and releases all resources.
Architectures
Last updated