Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
startStopRecording() {
if (!this.recording) {
this.recorder = new LocalRecorder(this.publisher.stream);
this.recorder.record();
document.getElementById('record-start-stop').innerHTML = 'Finish';
document.getElementById('record-pause-resume').style.display = 'inline-block';
} else {
this.recorder.stop()
.then(() => {
document.getElementById('post-video').getElementsByTagName('video')[0].style.display = 'none';
this.removeRecordingControls();
let recordingPreview: HTMLVideoElement = this.recorder.preview('post-video');
recordingPreview.controls = true;
this.addPostRecordingControls(recordingPreview);
})
.catch((e) => { });
}
this.recording = !this.recording;
}