overwolf.windows.mediaPlayerElement

Allows adding a media player element to a window to play video files.

Methods

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

Version added: 0.78

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

  • Parameter: x <int>

    The top position of the player.

  • Parameter: y <int>

    The left position of the player.

  • Parameter: width <int>

    The width of the player.

  • Parameter: height <int>

    The height of the player.

  • Parameter: callback <function>

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

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

removeAllPlayers()

Version added: 0.91.200

Remove all media players created for this window.

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

Version added: 0.91.200

Relocates the media player to a given location with given dimensions.

  • Parameter: id <int>

    The id of the player

  • Parameter: x <int>

    The top position of the player.

  • Parameter: y <int>

    The left position of the player.
  • Parameter: width <int>

    The width of the player.
  • Parameter: height <int>

    The height of the player.
  • Parameter: callback <function>

    A callback function which will be called with the status of the request.
Callback argument:
{
  "status": "success"
}

setVideo(id, videoUrl, callback)

Version added: 0.91.200

Sets the current video to be played.

  • Parameter: id <int>

    The id of the player.
  • Parameter: videoUrl <string>

    An url to the video.

  • Parameter: callback <function>

    A callback function which will be called with the status of the request. If successful, the callback will contain the total seconds in the video.

play(id, callback)

Version added: 0.91.200

Plays the current video.

  • Parameter: id <int>

    The id of the player.
  • Parameter: callback <function>

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

pause(id, callback)

Version added: 0.91.200

Pauses the current video.

  • Parameter: id <int>

    The id of the player.
  • Parameter: callback <function>

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

resume(id, callback)

Version added: 0.91.200

Resumes the current video.

  • Parameter: id <int>

    The id of the player.
  • Parameter: callback <function>

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

setVolume(id, volume, callback)

Version added: 0.91.200

Sets the volume.

  • Parameter: id <int>

    The id of the player.
  • Parameter: volume <int>

    A volume between 0 and 100 (inclusive).
  • Parameter: callback <function>

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

stop(id, callback)

Version added: 0.91.200

Stops the current video.

  • Parameter: id <int>

    The id of the player.
  • Parameter: callback <function>

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

seek(id, seconds, callback)

Version added: 0.91.200

Seeks the current video to the given number of seconds.

  • Parameter: id <int>

    The id of the player.
  • Parameter: seconds <int>

    The numbers of seconds to seek to.

  • Parameter: callback <function>

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

getProgress(id, callback)

Version added: 0.91.200

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

  • Parameter: id <int>

    The id of the player.
  • Parameter: callback <function>

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

setPlaybackSpeed(id, speedRatio, callback)

Version added: 0.91.200

Sets the speed ratio of the playback.

  • Parameter: id <int>

    The id of the player.
  • Parameter: speedRatio <double>

    The speed ratio of the playback. A double between 0 and 16 (inclusive).
  • Parameter: callback <function>

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

toFront(id, callback)

Version added: 0.91.200

Sends the media player to the front of the window.

  • Parameter: id <int>

    The id of the player.
  • Parameter: callback <function>

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

toBack(id, callback)

Version added: 0.91.200

Sends the media player to the back of the window.

  • Parameter: id <int>

    The id of the player.
  • Parameter: callback <function>

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

setStretchMode(id, stretchMode, callback)

Version added: 0.91.200

Sets the stretch mode of the player.

  • Parameter: id <int>

    The id of the media player.

  • Parameter: stretchMode <eStretch>

    The desired stretch mode, see eStretch.

  • Parameter: callback <function>

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

setTobiiLayer(id, TobiiLayerParams, callback)

Set Tobii replay layer params.

overwolf.media.setTobiiLayer(1, { //Recommended for better rounding. visible : true, effect: }, function(result) { console.log(result.url)} );
  • Parameter: id <int>

    The id of the player.

  • Parameter: TobiiLayerParams <TobiiLayerParams>

    The Tobii layer params

  • Parameter: callback <callback>

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

setTobiiLayer(TobiiLayerParams, callback)

Version added: 0.96.200

Set Tobii replay layer params for the default player.

  • Parameter: TobiiLayerParams <TobiiLayerParams>

    The Tobii layer params

  • Parameter: callback <function>

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

Events How to use events

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.

Types

eStretch

The stretch mode to use.

Options

None

Fill

Uniform

UniformToFill