overwolf.media.replays API
Use this API to capture a short video replay of the currently running game.
Please check the replay API sample app that demonstrates a primary usage in the API. Please read all the info about video capture usage and options on our video capture best practices guide.
Methods Reference
- overwolf.media.replays.turnOn()
- overwolf.media.replays.turnOff()
- overwolf.media.replays.getState()
- overwolf.media.replays.getState()
- overwolf.media.replays.capture()
- overwolf.media.replays.capture()
- overwolf.media.replays.startCapture()
- overwolf.media.replays.startCapture()
- overwolf.media.replays.stopCapture()
- overwolf.media.replays.stopCapture()
- overwolf.media.replays.getHighlightsFeatures()
- overwolf.media.replays.changeVolume()
Events Reference
- overwolf.media.replays.onCaptureError
- overwolf.media.replays.onCaptureStopped
- overwolf.media.replays.onCaptureWarning
- overwolf.media.replays.onReplayServicesStarted
- overwolf.media.replays.onHighlightsCaptured
Types Reference
- overwolf.media.replays.ReplayHighlightsSetting Object
- overwolf.media.replays.enums.ReplayType enum
- overwolf.media.replays.ReplayVideoOptions Object
- overwolf.media.replays.ReplayStreamParams Object
- overwolf.media.replays.TurnOnResult Object
- overwolf.media.replays.TurnOffResult Object
- overwolf.media.replays.GetStateResult Object
- overwolf.media.replays.ReplayResult Object
- overwolf.media.replays.StartReplayResult Object
- overwolf.media.replays.GetHighlightsFeaturesResult Object
- overwolf.media.replays.raw_events Object
- overwolf.media.replays.HighlightsCapturedEvent Object
- overwolf.media.replays.CaptureErrorEvent Object
- overwolf.media.replays.CaptureStoppedEvent Object
- overwolf.media.replays.CaptureWarningEvent Object
- overwolf.media.replays.ReplayServicesStartedEvent Object
- overwolf.media.replays.VideoSource Object
- overwolf.media.replays.WebCamParam Object
- overwolf.media.replays.GameWindowCapture Object
Sample app
In our APIs sample apps repository, you can find and download two sample apps that demonstrate the usage in the replays API:
- The
replay-manual Sample App
. Demonstrates how to use a manual capture using the replay API. - The
replay-auto-highlight Sample App
. Demonstrates how to use the auto-highlights mode using the replay API.
It's a great place to get started - All the samples in this repository are built with JS code and demonstrate primary usage in the API.
Functionality
The sample app's functionality is pretty straightforward: You launch it, open the dev console (to see all the debug messages), and hit the Turn On
button to start the capture and Turn Off
to stop it. In addition, you have the Get State
button that tells you the current state (if the capture mode is turn on or off).
You can look at the dev console to see the status of each call (success, failure, etc.). Once done, you can hit the open media folder to check the captured clip.
Besides the above, you have several minor differences between the manual app and the auto-highlights app:
replay-manual-sample
After hitting the "turn on" button, you have to manually click the "capture" button. That will initiate a short clip capture.
replay-auto-highlights-sample
In this sample app, you only have to click on the "turn on" button to initiate the auto-capture mode. Once the app recognizes supported auto highlight in the game (kill, death, etc.), it will auto-capture it. So no need to click on a "capture" button like in the manual capture app.
Note - if the current game does not support auto-highlights, the sample app will not work and display an error message.
Setting up
Download the app's source code from the repository as a zip file, and extract it to a new folder on your machine.
Load the app as an "unpacked extension" (Note that to do that you have to whitelist your OW username as a developer).
- Open the Overwolf desktop client settings (by right-clicking the client and selecting "Packages" Or by clicking on the wrench icon in the dock and going to the "About" tab => "Development Options").
- Click on "Development options".
- In the opened window, click on "Load unpacked extension" and select the extracted
replay-manual-sample
folder. This will add the manual sample app to your Overwolf dock. Do the same with thereplay-auto-highlights-sample
to install the auto-highlights sample app. - Make sure you are logged in to the OW client. Otherwise, you will get an "Unauthorized App" error message. (Click on the "Appstore" icon in the OW dock to login to the OW client).
- Click on the app's icons in your OW dock to run the apps.
turnOn(parameters, callback)
Version added: 0.130
Turns on background replay capturing. Without calling it first, you will not be able to create video replays.
Only apps that have the VideoCaptureSettings permission in the manifest are considered as a capture app and displayed in the OW client capture tab.
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.
Parameter | Type | Description |
---|---|---|
parameters | ReplaySetting object | Container for the capture configuration |
callback | (Result: TurnOnResult) => void | A callback function which will be called with the status of the request |
Important notes
turnOn()
will fail if highlights are requested but not supported for the current game.
To get the list of supported highlights call getHighlightsFeatures().- The below 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).
Usage Example
let streamSetting = {
"video": {
"sub_folder_name": folderName,
"buffer_length": bufferLength,
"base_frame_size_source" : ["Setting","Auto"] , // if not set, "Setting" is the default
"frame_size_method": ["Original", "ExactOrKeepRatio", "ExactOrClosestResolution"] , // // Original
"override_overwolf_setting" : false,
"fps" :30,
"width" :1920,
"height" : 1080
},
"quota": {
"max_quota_gb": 2,
"excluded_directories": [ "cool_session" ] //set directories that are not part of the quota
}
};
overwolf.media.replays.turnOn({
"settings": streamSetting,
"highlights": {
"enable" : true, //set false if you want to record the highligths manually
"requiredHighlights" : ["death","assist","victory"] // events to capture
}
}, callback);
turnOff(callback)
Version added: 0.117
Turns off background replay capturing. Call this as soon as you’re no longer interested in capturing, in order to free up resources.
Parameter | Type | Description |
---|---|---|
callback | (Result: TurnOffResult) => void | A 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" }
getState(replayType, callback)
Version added: 0.78
Returns whether replay capturing is turned on or off.
This function is Deprecated. Instead, please use overwolf.media.replays.getState().
Parameter | Type | Description |
---|---|---|
replayType | ReplayType enum | The type of replay to get state for |
callback | (Result: GetStateResult) => void | A callback function which will be called with the status of the request |