Fix style cam
authorgparant <g.parant@thecodingmachine.com>
Sun, 3 May 2020 12:29:45 +0000 (14:29 +0200)
committergparant <g.parant@thecodingmachine.com>
Sun, 3 May 2020 12:29:45 +0000 (14:29 +0200)
front/dist/resources/style/style.css
front/src/WebRtc/MediaManager.ts

index 049c3d1de9942ef9db18c5d51c170052fb78d7b7..4bcb70bce7a4fd5039c65121549166375840e8a4 100644 (file)
@@ -1,3 +1,7 @@
+video{
+    -webkit-transform: scaleX(-1);
+    transform: scaleX(-1);
+}
 .webrtc{
     display: none;
     position: absolute;
 .webrtc, .activeCam{}
 .activeCam video{
     position: absolute;
-    width: 300px;
-    height: 20%;
+    height: 25%;
     top: 10px;
-    right: 10px;
     margin: 5px;
+    right: -100px;
+    transition: all 0.2s ease;
+}
+.activeCam:hover video{
+    right: 10px;
 }
 .activeCam video#myCamVideo{
     width: 200px;
-    height: 100px;
+    height: 113px;
 }
 
 /*CSS size for 2 - 3 elements*/
index 4a875af276148e472fb9b254681a2ccaa34009ea..a0b6c0b8094b5775e7733b37bdcdb61a9ee1bf0b 100644 (file)
@@ -1,3 +1,8 @@
+const videoConstraint: {width : any, height: any, facingMode : string} = {
+    width: { ideal: 1280 },
+    height: { ideal: 720 },
+    facingMode: "user"
+};
 export class MediaManager {
     localStream: MediaStream;
     remoteVideo: Array<any> = new Array<any>();
@@ -6,7 +11,10 @@ export class MediaManager {
     cinema: any = null;
     microphoneClose: any = null;
     microphone: any = null;
-    constraintsMedia = {audio: true, video: true};
+    constraintsMedia : {audio : any, video : any} = {
+        audio: true,
+        video: videoConstraint
+    };
     getCameraPromise : Promise<any> = null;
 
     constructor() {
@@ -47,7 +55,7 @@ export class MediaManager {
     enabledCamera() {
         this.cinemaClose.style.display = "none";
         this.cinema.style.display = "block";
-        this.constraintsMedia.video = true;
+        this.constraintsMedia.video = videoConstraint;
         this.localStream = null;
         this.myCamVideo.srcObject = null;
     }
@@ -106,6 +114,13 @@ export class MediaManager {
             .then((stream: MediaStream) => {
                 this.localStream = stream;
                 this.myCamVideo.srcObject = this.localStream;
+
+                //TODO resize remote cam
+                /*console.log(this.localStream.getTracks());
+                let videoMediaStreamTrack =  this.localStream.getTracks().find((media : MediaStreamTrack) => media.kind === "video");
+                let {width, height} = videoMediaStreamTrack.getSettings();
+                console.info(`${width}x${height}`); // 6*/
+
                 return stream;
             }).catch((err) => {
                 console.error(err);