openvidu-browser: bug fix (unmirror existing video if mirror = false)

pull/154/head
pabloFuente 2018-10-25 11:30:36 +02:00
parent 7f3248f628
commit 686d6699c9
1 changed files with 9 additions and 1 deletions

View File

@ -338,7 +338,10 @@ export class StreamManager implements EventDispatcher {
} }
if (!this.remote && !this.stream.displayMyRemote()) { if (!this.remote && !this.stream.displayMyRemote()) {
video.muted = true; 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); this.mirrorVideo(video);
} }
} }
@ -424,4 +427,9 @@ export class StreamManager implements EventDispatcher {
video.style.webkitTransform = 'rotateY(180deg)'; video.style.webkitTransform = 'rotateY(180deg)';
} }
private removeMirrorVideo(video): void {
video.style.transform = 'unset';
video.style.webkitTransform = 'unset';
}
} }