From f158119d68bce8d52fd2d24b516bc1ae271c550c Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Wed, 26 Jan 2022 18:51:20 +0100 Subject: [PATCH] openvidu-browser: error message when calling deprecated LocalRecorder#record(string) --- openvidu-browser/src/OpenVidu/LocalRecorder.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openvidu-browser/src/OpenVidu/LocalRecorder.ts b/openvidu-browser/src/OpenVidu/LocalRecorder.ts index 23badb5f..2351b6fa 100644 --- a/openvidu-browser/src/OpenVidu/LocalRecorder.ts +++ b/openvidu-browser/src/OpenVidu/LocalRecorder.ts @@ -83,6 +83,9 @@ export class LocalRecorder { record(options?: any): Promise { 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'));