Commit c5638a54 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Mirror own video.

parent 29e98f4f
...@@ -814,6 +814,10 @@ h1 { ...@@ -814,6 +814,10 @@ h1 {
opacity: 0.7; opacity: 0.7;
} }
.mirror {
transform: scaleX(-1);
}
#inputform { #inputform {
width: 100%; width: 100%;
} }
......
...@@ -829,7 +829,7 @@ async function addLocalMedia(id) { ...@@ -829,7 +829,7 @@ async function addLocalMedia(id) {
c.onstats = gotUpStats; c.onstats = gotUpStats;
c.setStatsInterval(2000); c.setStatsInterval(2000);
await setMedia(c, true); await setMedia(c, true, true);
setButtonsVisibility(); setButtonsVisibility();
} }
...@@ -931,7 +931,7 @@ async function addFileMedia(file) { ...@@ -931,7 +931,7 @@ async function addFileMedia(file) {
delUpMedia(c); delUpMedia(c);
} }
}; };
setMedia(c, true, video); setMedia(c, true, false, video);
c.userdata.play = true; c.userdata.play = true;
setButtonsVisibility() setButtonsVisibility()
} }
...@@ -1020,11 +1020,13 @@ function muteLocalTracks(mute) { ...@@ -1020,11 +1020,13 @@ function muteLocalTracks(mute) {
* @param {Stream} c * @param {Stream} c
* @param {boolean} isUp * @param {boolean} isUp
* - indicates whether the stream goes in the up direction * - indicates whether the stream goes in the up direction
* @param {boolean} [mirror]
* - whether to mirror the video
* @param {HTMLVideoElement} [video] * @param {HTMLVideoElement} [video]
* - the video element to add. If null, a new element with custom * - the video element to add. If null, a new element with custom
* controls will be created. * controls will be created.
*/ */
function setMedia(c, isUp, video) { function setMedia(c, isUp, mirror, video) {
let peersdiv = document.getElementById('peers'); let peersdiv = document.getElementById('peers');
let div = document.getElementById('peer-' + c.id); let div = document.getElementById('peer-' + c.id);
...@@ -1058,6 +1060,8 @@ function setMedia(c, isUp, video) { ...@@ -1058,6 +1060,8 @@ function setMedia(c, isUp, video) {
div.appendChild(media); div.appendChild(media);
if(!video) if(!video)
addCustomControls(media, div, c); addCustomControls(media, div, c);
if(mirror)
media.classList.add('mirror');
} }
if(!video) if(!video)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment