diff --git a/openvidu-browser/src/OpenVidu/OpenVidu.ts b/openvidu-browser/src/OpenVidu/OpenVidu.ts index a5dfb357..55ff8766 100644 --- a/openvidu-browser/src/OpenVidu/OpenVidu.ts +++ b/openvidu-browser/src/OpenVidu/OpenVidu.ts @@ -89,9 +89,8 @@ export class OpenVidu { const oldWidth = publisher.stream.videoDimensions.width; const oldHeight = publisher.stream.videoDimensions.height; - const getNewVideoDimensions = (): Promise<{newWidth: number, newHeight: number}> => { + const getNewVideoDimensions = (): Promise<{ newWidth: number, newHeight: number }> => { return new Promise((resolve, reject) => { - let newVideoDimensions: { newWidth: number, newHeight: number }; if (platform['isIonicIos']) { // iOS Ionic. Limitation: must get new dimensions from an existing video element already inserted into DOM resolve({ @@ -102,10 +101,10 @@ export class OpenVidu { // Rest of platforms // New resolution got from different places for Chrome and Firefox. Chrome needs a videoWidth and videoHeight of a videoElement. // Firefox needs getSettings from the videoTrack - let firefoxSettings = publisher.stream.getMediaStream().getVideoTracks()[0].getSettings(); + const firefoxSettings = publisher.stream.getMediaStream().getVideoTracks()[0].getSettings(); const newWidth = ((platform.name!!.toLowerCase().indexOf('firefox') !== -1) ? firefoxSettings.width : publisher.videoReference.videoWidth); const newHeight = ((platform.name!!.toLowerCase().indexOf('firefox') !== -1) ? firefoxSettings.height : publisher.videoReference.videoHeight); - resolve({newWidth, newHeight}); + resolve({ newWidth, newHeight }); } }); }; diff --git a/openvidu-browser/src/OpenVidu/Publisher.ts b/openvidu-browser/src/OpenVidu/Publisher.ts index 5f6e1edf..088545b5 100644 --- a/openvidu-browser/src/OpenVidu/Publisher.ts +++ b/openvidu-browser/src/OpenVidu/Publisher.ts @@ -326,7 +326,7 @@ export class Publisher extends StreamManager { this.stream.isLocalStreamReadyToPublish = true; this.stream.ee.emitEvent('stream-ready-to-publish', []); document.body.removeChild(this.videoReference); - } + }; let interval; this.videoReference.onloadedmetadata = () => {