Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Jan 10, 2025
1 parent abe8d36 commit 9463511
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugin/Live/WebRTC/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,16 @@ function sendStreamToServer(stream) {
const options = {
mimeType: 'video/webm; codecs=vp8,opus' // Check for Safari compatibility
};

var mediaRecorder;
try {
const mediaRecorder = new MediaRecorder(stream, options);
console.log('MediaRecorder initialized with options:', options);
mediaRecorder = new MediaRecorder(stream, options);
} catch (error) {
avideoToastError(`Failed to initialize MediaRecorder with options: ${error}`);
try {
mediaRecorder = new MediaRecorder(stream);
} catch (error) {
avideoToastError(`Failed to initialize MediaRecorder: ${error}`);
}
}

mediaRecorder.ondataavailable = (event) => {
Expand Down

0 comments on commit 9463511

Please sign in to comment.