overwolf.media.replays

Use the overwolf.media.replays API to capture a short video replay of the currently running game.

Methods

turnOn(settings, highlights, callback)

Version added: 0.130

Turns on background replay capturing. Without calling it first, you will not be able to create video replays.
Using this method you can quickly get the game highlights videos without the overhead of using both OW events and streaming API’s.  
There’s no need to know/understand each supported game’s mechanics, game flow, edge cases, timings, etc. Just request for any supported game highlight and OW will provide you with a video file that includes this event. 

An example call:

overwolf.media.replays.turnOn({
      "settings": settings,
      "highlights": {
        "enable" : true,
        "requiredHighlights" : ["death","assist","victory"] //an interesting evenst that happened in game
      }
    }, callback);

Few important notes:

  • Turning on replay capturing will consume system resources, so use it wisely. buffer_length defines the amount of time in milliseconds to have captured in the memory at all times.
  • turnOn will fail if highlights are requested but not supported for the current game. (to get the list of supported highlights call gethighlights())
  • The above call will override your current OW client settings only if video setting is not null or values are different than zero.
  • For each OW app that uses this feature, a new video folder will be created. So in theory, a few OW installed apps can capture the same highlight, from the same game (if all these apps set to capture this highlight from this game of course). 
  • Parameter: settings <StreamSettings>

    The video capture settings. A JSON file which can consist any of the following:

    "settings": {
    	"video": { "buffer_length": 20000 },
    	"audio": {
    	    "mic": {
    	        "volume": 100,
    		"enabled": true
    	    },
    	    "game": {
    	        "volume": 75,
    		"enabled": true
    	    }
             },
    	    "peripherals": { "capture_mouse_cursor": "both" }
    	 }
    }

    For more information about this JSON, see overwolf.streaming.

  • Parameter: highlights <ReplayHighlightsSetting>

    The highlights capture settings. A JSON file which can consist any of the following:

    "highlights": {
            "enable" : true,
            "requiredHighlights" : ["*.*"]
    }
    
  • Parameter: callback <function>

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

Callback argument:
{
    "status": "success"
}

turnOff(replayType, callback)

Version added: 0.78

Obsolete

Turns off background replay capturing. Call this as soon as you no longer interesting in capturing video, in order to free up resources.

  • Parameter: replayType <ReplayType>

    The type of replay to turn off.

  • Parameter: callback <function>

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

turnOff(callback)

Version added: 0.117.1

Turns off background replay capturing. Call this as soon as you’re no longer interested in capturing, in order to free up resources.

  • Parameter: callback <function>

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

getState(replayType, callback)

Version added: 0.78

Returns whether replay capturing is turned on or off.

  • Parameter: replayType <ReplayType>

    The type of replay to get state for.

  • Parameter: callback <function>

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

Callback argument:
{
    "status": "success",
    "isOn": true
}

getState(callback)

Version added: 0.117.1

Returns whether replay capturing is turned on or off.

  • Parameter: callback <function>

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

capture(replayType, pastDuration, futureDuration, captureFinishedCallback, callback)

Version added: 0.78

Starts capturing a replay to a file. A replay id will be returned in the callback which is needed to finish capturing the replay. You can only call this method if replay mode is on and no other replay is currently being captured to a file.

  • Parameter: replayType <ReplayType>

    The type of replay to capture.

  • Parameter: pastDuration <int>

    The video lengh, in milliseconds to include prior to the time of this call.

  • Parameter: futureDuration <int>

    The video lengh, in milliseconds to include after the time of this call. To ignore it, simply give it a non-positive value

  • Parameter: captureFinishedCallback <function>

    A callback function which will be called when capturing is finished, at the end of the future duration supplied to this call.

  • Parameter: callback <function>

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

Callback argument:
{
    "status": "success",
    "url": "overwolf://media/replays/App+Name/Dota+2+06-28-2016+17-55-59-435.mp4",
    "path": "E:/Video/Overwolf/App Name/Dota 2 06-28-2016 17-55-59-435.mp4",
    "duration": 10512,
    "start_time": 1467125753892,
    "thumbnail_url": "overwolf://media/thumbnails/App+Name/Dota+2+06-28-2016+17-55-59-435.mp4"
}

capture(pastDuration, futureDuration, captureFinishedCallback, callback)

Version added: 0.117.1

Starts capturing a replay to a file. A replay id will be returned in the callback which is needed to finish capturing the replay. You can only call this method if replay mode is on and no other replay is currently being captured to a file.

  • Parameter: pastDuration <int>

    The replay length in milliseconds to include prior to the time of this call.

  • Parameter: futureDuration <int>

    A callback function which will be called when capturing is finished, at the end of the future duration supplied to this call

  • Parameter: captureFinishedCallback <function>

    A callback function which will be called when capturing is finished, at the end of the future duration supplied to this call.

  • Parameter: callback <function>

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

startCapture(replayType, pastDuration, callback)

Version added: 0.78

Starts capturing a replay to a file. A replay id will be returned in the callback which is needed to finish capturing the replay. You can only call this method if replay mode is on and no other replay is currently being captured to a file.

  • Parameter: replayType <ReplayType>

    The type of replay to capture.

  • Parameter: pastDuration <int>

    The video lengh, in milliseconds to include prior to the time of this call.

  • Parameter: callback <function>

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

Callback argument:
{
    "status": "success",
    "url": "overwolf://media/replays/App+Name/Dota+2+06-28-2016+17-59-37-620.mp4",
    "path": "E://Video/Overwolf/App Name/Dota 2 06-28-2016 17-59-37-620.mp4"
}

startCapture(pastDuration, callback)

Version added: 0.117.1

Starts capturing a replay to a file. A replay id will be returned in the callback which is needed to finish capturing the replay. You can only call this method if replay mode is on and no other replay is currently being captured to a file

  • Parameter: pastDuration <int>

    The video lengh, in milliseconds to include prior to the time of this call

  • Parameter: callback <function>

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

stopCapture(ReplayType, replayId, callback)

Version added: 0.78

Finishes capturing a replay and returns a url to the created video file. You can only call this method if replay mode is on and using a valid id of a replay being captured to a file (“url” property).

  • Parameter: ReplayType <ReplayType>

    The type of replay to stop capture.

  • Parameter: replayId <string>

    The id of the replay you want to finish capturing.

  • Parameter: callback <function>

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

Callback argument:
{
    "status": "success",
    "url": "overwolf://media/replays/App+Name/Dota+2+06-28-2016+17-59-37-620.mp4",
    "path": "E://Video/Overwolf/App Name/Dota 2 06-28-2016 17-59-37-620.mp4",
    "duration": 84556,
    "start_time": 1467125971875,
    "thumbnail_url": "overwolf://media/thumbnails/App+Name/Dota+2+06-28-2016+17-59-37-620.mp4"
}

stopCapture(replayId, callback)

Version added: 0.117.1

Stops capturing a replay and returns a url to the created video file. You can only call this method if replay mode is on and using a valid id of a replay being captured to a file.

  • Parameter: replayId <string>

    The id of the replay you want to stop capturing.

  • Parameter: callback <function>

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

updateTobiiSetting(param, callback)

Version added: 0.110.2.0

Update Tobii streaming layer.

Example:

overwolf.media.replays.updateTobiiSetting({
    visible: true,
    effect: overwolf.streaming.enums.eTobiiEffectType.Bubble},
    function(res) {
       if (res.status == 'success') { }
    });

 

  • Parameter: param <TobiiLayerParams>

    The Tobii layer visibility param

  • Parameter: callback <function>

    A function that will be called with a JSON containing the status and the stream id if successful:

    {"status": "success","stream_id": 1}

    or an error message if not:

    {"status": "error", "something went wrong..."}d

getHighlights(gameId, callback)

Version added: 0.130

Get supported auto highlights features for a game.

  • Parameter: gameId <int>

    The id of the game you want to capture it highlights.

  • Parameter: callback <function>

    A callback function which provides a list of the generated video highlights URL’s for this session and relevant metadata for each highlight.

Events How to use events

onCaptureError

Version added: 0.78

Fired when an errror has occured with the capturing.

onCaptureStopped

Version added: 0.117.1

Fired when replay service is stopped.

onCapureWarning

Version added: 0.117.1

Fired on capture service warning

onReplayServicesStarted

Version added: 0.117.1

Fired when an replay service was started (on any app)

onHighlightsCaptured

Version added: 0.130

Fired when a new Replay highlight recorded (when highlightsSetting is enabled).

Types

ReplayHighlightsSetting

Auto highlights configuration.

Options

enable

<bool>

Enable auto Highlights recording

requiredHighlights

<string>

An array of requested highlights use ["*"] to register all features.

You can get the list of the supported highlights using the method gethighlights()

ReplayType

The replay type to use.

Options

video

gif