Just one more question. I am trying to implement a start and stop function to record, but I’m able to record only once. The second time showsthe following message
Uncaught DOMException: Failed to execute ‘stop’ on ‘MediaRecorder’: The MediaRecorder’s state is ‘inactive’.
$("#video").click(function(){
if (scene.activeCamera == camera) {
if (BABYLON.VideoRecorder.IsSupported(engine)) {
var recorder = new BABYLON.VideoRecorder(engine,camera,2500);
recorder.startRecording("video.mp4", 3600);
$("#stop").show();
var myTimer= function(){$("#stop").click(function(){recorder.stopRecording(); $("#stop").hide();clearInterval(myVar);})};
let myVar = setInterval(myTimer,3600);
}}
else if(scene.activeCamera == camera2){
if (BABYLON.VideoRecorder.IsSupported(engine)) {
var recorder = new BABYLON.VideoRecorder(engine,camera2,2500);
recorder.startRecording("video.mp4", 3600);
$("#stop").show();
var myTimer= function(){$("#stop").click(function(){recorder.stopRecording(); $("#stop").hide();clearInterval(myVar);})};
let myVar = setInterval(myTimer,3600);
}}
});
I want to stop the video as soon as I press the button, but the action happens only after 3600 seconds has passed. How can I stop the video before 3600 seconds