overwolf.media.replays

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

Methods

turnOn(settings, callback)

Version added: 0.78

Turns on background replay capturing. Without calling it first, you will not be able to create video replays. Notice that 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.

  • 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: callback <function>

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

turnOff(replayType, callback)

Version added: 0.78

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.

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
}

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"
}

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"
}

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"
}

Events How to use events

onCaptureError

Version added: 0.78

Fired when an errror has occured with the capturing.

Types

ReplayType

The replay type to use.