Skip to content

Commit

Permalink
Place simultaneous video recording behind pref
Browse files Browse the repository at this point in the history
  • Loading branch information
hobinjk-ptc committed Mar 26, 2024
1 parent 6e61452 commit 4037513
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions tools/spatialAnalytics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
const MINIMIZED_TOOL_WIDTH = 1200;
const MINIMIZED_TOOL_HEIGHT = 600;

const RECORD_VIDEO = false;

let spatialInterface;

let startTime = Date.now(); // 1675809876408 - 20
Expand Down Expand Up @@ -101,7 +103,9 @@ recordingIcon.addEventListener('pointerup', function() {
spatialInterface.analyticsHydrate(data);
}

spatialInterface.startVirtualizerRecording();
if (RECORD_VIDEO) {
spatialInterface.startVirtualizerRecording();
}
break;
case RecordingState.recording:
setRecordingState(RecordingState.saving);
Expand All @@ -120,16 +124,22 @@ recordingIcon.addEventListener('pointerup', function() {
});
}

spatialInterface.stopVirtualizerRecording((baseUrl, recordingId, deviceId) => {
if (RECORD_VIDEO) {
spatialInterface.stopVirtualizerRecording((baseUrl, recordingId, deviceId) => {
setRecordingState(RecordingState.done);
const urls = {
color: `${baseUrl}/virtualizer_recordings/${deviceId}/color/${recordingId}.mp4`,
rvl: `${baseUrl}/virtualizer_recordings/${deviceId}/depth/${recordingId}.dat`
};
data.videoUrls = urls;
spatialInterface.writePublicData('storage', 'analyticsData', data);
spatialInterface.analyticsHydrate(data);
});
} else {
setRecordingState(RecordingState.done);
const urls = {
color: `${baseUrl}/virtualizer_recordings/${deviceId}/color/${recordingId}.mp4`,
rvl: `${baseUrl}/virtualizer_recordings/${deviceId}/depth/${recordingId}.dat`
};
data.videoUrls = urls;
spatialInterface.writePublicData('storage', 'analyticsData', data);
spatialInterface.analyticsHydrate(data);
});
}
break;
case RecordingState.done:
break;
Expand Down

0 comments on commit 4037513

Please sign in to comment.