openvidu-browser: error message when calling deprecated LocalRecorder#record(string)

pull/690/head
pabloFuente 2022-01-26 18:51:20 +01:00
parent 925a51482d
commit f158119d68
1 changed files with 3 additions and 0 deletions

View File

@ -83,6 +83,9 @@ export class LocalRecorder {
record(options?: any): Promise<void> {
return new Promise((resolve, reject) => {
try {
if (typeof options === 'string' || options instanceof String) {
return reject(`When calling LocalRecorder.record(options) parameter 'options' cannot be a string. Must be an object like { mimeType: "${options}" }`);
}
if (typeof MediaRecorder === 'undefined') {
logger.error('MediaRecorder not supported on your device. See compatibility in https://caniuse.com/#search=MediaRecorder');
throw (Error('MediaRecorder not supported on your device. See compatibility in https://caniuse.com/#search=MediaRecorder'));