Skip to content

Commit

Permalink
Merge pull request #465 from Jenfong/main
Browse files Browse the repository at this point in the history
fix firefox's unsupported codec error
  • Loading branch information
deleolajide committed Dec 1, 2023
2 parents 3724b6a + 9ddbf0a commit 734a31c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/webapp/custom_ofmeet.js
Original file line number Diff line number Diff line change
Expand Up @@ -2608,6 +2608,24 @@ var ofmeet = (function (ofm) {
console.debug('ofmeet.js startDesktopRecorder - live streaming', tracks, ws_url);

let websocket = connectLiveStream("wss://" + ws_url[2] + "/livestream-ws/", config.ofmeetStreamKey);
//fix firefox's unsupported codec error
let mimeType = ''
//Safari not support isTypeSupported
if (MediaRecorder.isTypeSupported){
mimeType= 'video/webm;codecs=h264'
if (!MediaRecorder.isTypeSupported(mimeType)) {
console.log(`${mimeType} is not Supported`);
mimeType = "video/webm;codecs=vp9"
if (!MediaRecorder.isTypeSupported(mimeType)) {
console.log(`${mimeType} is not Supported`);
mimeType = "video/webm"
if (!MediaRecorder.isTypeSupported(mimeType)) {
console.log(`${mimeType} is not Supported`);
mimeType = ""
}
}
}
}
videoRecorder[id] = new MediaRecorder(recorderStreams[id], { mimeType: 'video/webm;codecs=h264', bitsPerSecond: 256 * 8 * 1024 });

videoRecorder[id].ondataavailable = function (e) {
Expand Down

0 comments on commit 734a31c

Please sign in to comment.