+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>();
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() {
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;
}
.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);