From 686d6699c960c84f9b089bd1ee8911e415054345 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Thu, 25 Oct 2018 11:30:36 +0200 Subject: [PATCH] openvidu-browser: bug fix (unmirror existing video if mirror = false) --- openvidu-browser/src/OpenVidu/StreamManager.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openvidu-browser/src/OpenVidu/StreamManager.ts b/openvidu-browser/src/OpenVidu/StreamManager.ts index 742b55f7..3c8b3521 100644 --- a/openvidu-browser/src/OpenVidu/StreamManager.ts +++ b/openvidu-browser/src/OpenVidu/StreamManager.ts @@ -338,7 +338,10 @@ export class StreamManager implements EventDispatcher { } if (!this.remote && !this.stream.displayMyRemote()) { video.muted = true; - if (this.stream.outboundStreamOpts.publisherProperties.mirror) { + if (video.style.transform === 'rotateY(180deg)' && this.stream.outboundStreamOpts.publisherProperties.mirror) { + // If the video was already rotated and now is set to not mirror + this.removeMirrorVideo(video); + } else if (this.stream.outboundStreamOpts.publisherProperties.mirror) { this.mirrorVideo(video); } } @@ -424,4 +427,9 @@ export class StreamManager implements EventDispatcher { video.style.webkitTransform = 'rotateY(180deg)'; } + private removeMirrorVideo(video): void { + video.style.transform = 'unset'; + video.style.webkitTransform = 'unset'; + } + } \ No newline at end of file