this is my code. I want to log the capture video once, But by using this code. It is getting captured multiple times.
class InGame extends AppWindow {
private static _instance: InGame;
private _fortniteGameEventsListener: OWGamesEvents;
private _eventsLog: HTMLElement;
private _infoLog: HTMLElement;
private constructor() {
super(windowNames.inGame);
this._eventsLog = document.getElementById('eventsLog');
this._infoLog = document.getElementById('infoLog');
this.setToggleHotkeyBehavior();
this.setToggleHotkeyText();
this._fortniteGameEventsListener = new OWGamesEvents({
onInfoUpdates: this.onInfoUpdates.bind(this),
onNewEvents: this.onNewEvents.bind(this)
},
interestingFeatures);
}
private onNewEvents(e) {
const shouldHighlight = e.events.some(event => {
return event.name === 'kill' ||
event.name === 'death' ||
event.name === 'assist' ||
event.name === 'level'
});
// Video Capturing code....
let self = this;
overwolf.media.replays.turnOn({
"highlights" : {
"enable" : true,
"requiredHighlights" : ["kill","death","assist","victory"]
},
"settings" : {
"gif_as_video": false,
"max_quota_gb" : 2,
"video" : {
"sub_folder_name" : "C:\Users\91994\Videos\Overwolf",
"auto_calc_kbps":true,
"fps" :30,
"width" :1920,
"height" : 1080,
"max_kbps" : 100,
"buffer_length":3000,
"frame_interval": 30,
"test_drop_frames_interval":100,
"notify_dropped_frames_ratio": 30,
"max_file_size_bytes" : 10000000,
"include_full_size_video" : false,
"override_overwolf_setting":true,
"disable_when_sht_not_supported" : false ,
"indication_position": overwolf.streaming.enums.IndicationPosition.BottomLeftCorner,
"indication_type":overwolf.streaming.enums.IndicationType.DotAndTimer,
"use_app_display_name" : true
}
}
}, function(status) {
self.logLine(self._eventsLog, "Video Capture Callback Status : " + JSON.stringify(status, null, 2) , true);
});
overwolf.media.replays.onHighlightsCaptured.addListener(function(info) {
overwolf.extensions.io.writeTextFile(overwolf.extensions.io.enums.StorageSpace.pictures,"onHighlightsCaptured", JSON.stringify(info, null, 2),
console.log);
});
this.logLine(this._eventsLog, e, shouldHighlight);
}