Skip to main content

overwolf.windows.mediaPlayerElement API

Use this API to allows adding a media player element to a window to play video files.

Methods Reference

Events Reference

Types Reference

create(x, y, width, height, callback)

Version added: 0.78

Creates a media player and places it in the given location with given dimensions.

ParameterTypeDescription
xintThe top position of the player
yintThe left position of the player
widthintThe width of the player
heightintThe height of the player
callbackfunctionA callback function which will be called with the status of the request

Callback argument: Success

A callback function which will be called with the status of the request and the given player id

{ "status": "success", "id": 3 }

removeAllPlayers()

Version added: 0.78

Remove all media players created for this window.

setBounds(id, x, y, width, height, callback)

Version added: 0.78

Creates a media player and places it in the given location with given dimensions.

ParameterTypeDescription
idintThe id of the player
xintThe top position of the player
yintThe left position of the player
widthintThe width of the player
heightintThe height of the player
callbackfunctionA callback function which will be called with the status of the request

Callback argument: Success

A callback function which will be called with the status of the request

{ "status": "success" }

setVideo(id, videoUrl, callback)

Version added: 0.78

Sets the current video to be played.

ParameterTypeDescription
idintThe id of the player
videoUrlstringAn url to the video
callbackfunctionA callback function which will be called with the status of the request

play(id, callback)

Version added: 0.78

Plays the current video.

ParameterTypeDescription
idintThe id of the player
callbackfunctionA callback function which will be called with the status of the request

pause(id, callback)

Version added: 0.78

Pauses the current video.

ParameterTypeDescription
idintThe id of the player
callbackfunctionA callback function which will be called with the status of the request

resume(id, callback)

Version added: 0.78

Resumes the current video.

ParameterTypeDescription
idintThe id of the player
callbackfunctionA callback function which will be called with the status of the request

setVolume(id, volume, callback)

Version added: 0.78

Sets the volume.

ParameterTypeDescription
idintThe id of the player
volumeintA volume between 0 and 100 (inclusive)
callbackfunctionA callback function which will be called with the status of the request

stop(id, callback)

Version added: 0.78

Stops the current video.

ParameterTypeDescription
idintThe id of the player
callbackfunctionA callback function which will be called with the status of the request

seek(id, seconds, callback)

Version added: 0.78

Seeks the current video to the given number of seconds.

ParameterTypeDescription
idintThe id of the player
secondsintThe numbers of seconds to seek to
callbackfunctionA callback function which will be called with the status of the request

getProgress(id, callback)

Version added: 0.78

Gets the current progress, in seconds, of the playback.

ParameterTypeDescription
idintThe id of the player
callbackfunctionA callback function which will be called with the status of the request

setPlaybackSpeed(id, speedRatio, callback)

Version added: 0.78

Sets the speed ratio of the playback.

ParameterTypeDescription
idintThe id of the player
speedRatiodoubleThe speed ratio of the playback. A double between 0 and 16 (inclusive)
callbackfunctionA callback function which will be called with the status of the request

toFront(id, callback)

Version added: 0.78

Sends the media player to the front of the window.

ParameterTypeDescription
idintThe id of the player
callbackfunctionA callback function which will be called with the status of the request

toBack(id, callback)

Version added: 0.78

Sends the media player to the back of the window.

ParameterTypeDescription
idintThe id of the player
callbackfunctionA callback function which will be called with the status of the request

setStretchMode(id, stretchMode, callback)

Version added: 0.78

Sets the stretch mode of the player.

ParameterTypeDescription
idintThe id of the player
stretchModeeStretch enumThe desired stretch mode
callbackfunctionA callback function which will be called with the status of the request

onPlaybackStarted

Version added: 0.78

Fired when playback is starting/resuming.

onPlaybackPaused

Version added: 0.78

Fired when playback is paused.

onPlaybackStopped

Version added: 0.78

Fired when playback is stopped.

onPlaybackEnded

Version added: 0.78

Fired when playback ends.

onPlaybackError

Version added: 0.78

Fired when there was an error while trying to open a video.

eStretch enum

Version added: 0.78

The stretch mode to use.

OptionDescription
None
Fill
Uniform
UniformToFill