MDL-78391 atto_recordrtc: Fix recording issue with Chrome

This commit is contained in:
Huong Nguyen
2023-07-06 15:49:56 +07:00
parent 0f7151e2ba
commit 7a582cf628
5 changed files with 11 additions and 17 deletions
@@ -191,9 +191,7 @@ M.atto_recordrtc.commonmodule = {
getFileExtension: function(type) {
if (type === 'audio') {
if (window.MediaRecorder.isTypeSupported('audio/webm')) {
return 'webm';
} else if (window.MediaRecorder.isTypeSupported('audio/ogg')) {
if (window.MediaRecorder.isTypeSupported('audio/ogg')) {
return 'ogg';
} else if (window.MediaRecorder.isTypeSupported('audio/mp4')) {
return 'mp4';
@@ -493,8 +491,8 @@ M.atto_recordrtc.abstractmodule = {
if (recType === 'audio') {
types = [
// Firefox and Chrome both support webm and ogg.
'audio/webm;codecs=opus',
// Firefox supports webm and ogg but Chrome only supports ogg.
// So we use ogg to maximize the compatibility.
'audio/ogg;codecs=opus',
// Safari supports mp4.
File diff suppressed because one or more lines are too long
@@ -191,9 +191,7 @@ M.atto_recordrtc.commonmodule = {
getFileExtension: function(type) {
if (type === 'audio') {
if (window.MediaRecorder.isTypeSupported('audio/webm')) {
return 'webm';
} else if (window.MediaRecorder.isTypeSupported('audio/ogg')) {
if (window.MediaRecorder.isTypeSupported('audio/ogg')) {
return 'ogg';
} else if (window.MediaRecorder.isTypeSupported('audio/mp4')) {
return 'mp4';
@@ -493,8 +491,8 @@ M.atto_recordrtc.abstractmodule = {
if (recType === 'audio') {
types = [
// Firefox and Chrome both support webm and ogg.
'audio/webm;codecs=opus',
// Firefox supports webm and ogg but Chrome only supports ogg.
// So we use ogg to maximize the compatibility.
'audio/ogg;codecs=opus',
// Safari supports mp4.
@@ -80,8 +80,8 @@ M.atto_recordrtc.abstractmodule = {
if (recType === 'audio') {
types = [
// Firefox and Chrome both support webm and ogg.
'audio/webm;codecs=opus',
// Firefox supports webm and ogg but Chrome only supports ogg.
// So we use ogg to maximize the compatibility.
'audio/ogg;codecs=opus',
// Safari supports mp4.
@@ -189,9 +189,7 @@ M.atto_recordrtc.commonmodule = {
getFileExtension: function(type) {
if (type === 'audio') {
if (window.MediaRecorder.isTypeSupported('audio/webm')) {
return 'webm';
} else if (window.MediaRecorder.isTypeSupported('audio/ogg')) {
if (window.MediaRecorder.isTypeSupported('audio/ogg')) {
return 'ogg';
} else if (window.MediaRecorder.isTypeSupported('audio/mp4')) {
return 'mp4';