<script src="bundle.js"></script>
<div id="webRtc" class="webrtc">
<div id="activeCam" class="activeCam">
- <video id="myCamVideo" autoplay></video>
+ <video id="myCamVideo" autoplay muted></video>
</div>
- <div class="btn-cam-action active">
+ <div class="btn-cam-action">
<div class="btn-micro">
<img id="microphone" src="resources/logos/microphone.svg">
<img id="microphone-close" src="resources/logos/microphone-close.svg">
<img id="cinema" src="resources/logos/cinema.svg">
<img id="cinema-close" src="resources/logos/cinema-close.svg">
</div>
- <div class="btn-call">
+ <!--<div class="btn-call">
<img src="resources/logos/phone.svg">
- </div>
+ </div>-->
</div>
</div>
- <div id="phone-open" class="phone-open">
- <img src="resources/logos/phone-open.svg">
- </div>
</body>
</html>
right: -100px;
transition: all 0.2s ease;
}
-.activeCam:hover video{
+.webrtc:hover .activeCam video{
right: 10px;
}
.activeCam video#myCamVideo{
transition-timing-function: ease-in-out;
bottom: 20px;
}
-.webrtc:hover .btn-cam-action.active div{
+.webrtc:hover .btn-cam-action div{
transform: translateY(0);
}
.btn-cam-action div:hover{
}
.btn-micro{
transition: all .3s;
- left: 168px;
+ right: 10px;
}
.btn-video{
transition: all .2s;
- left: 84px;
+ right: 114px;
}
-.btn-call{
+/*.btn-call{
transition: all .1s;
left: 0px;
-}
+}*/
.btn-cam-action div img{
height: 32px;
width: 40px;
top: calc(48px - 32px);
left: calc(48px - 35px);
position: relative;
-}
-
-/*Phone Animation*/
-.phone-open{
- position: absolute;
- border-radius: 50%;
- width: 50px;
- height: 50px;
- left: calc(50% - 70px);
- padding: 20px;
- bottom: 20px;
- box-shadow: 2px 2px 24px #444;
- background-color: green;
- opacity: 0;
- transition: all .4s ease-in-out;
-}
-.phone-open.active{
- opacity: 1;
- animation-name: phone-move;
- animation-duration: 0.4s;
- animation-iteration-count: infinite;
- animation-timing-function: linear;
-}
-.phone-open:hover{
- animation: none;
- cursor: pointer;
-}
-@keyframes phone-move {
- 0% {
- left: calc(50% - 70px);
- bottom: 20px;
- }
- 25% {
- left: calc(50% - 65px);
- bottom: 15px;
- }
- 25% {
- left: calc(50% - 75px);
- bottom: 25px;
- }
}
\ No newline at end of file
Layers : Array<Phaser.Tilemaps.StaticTilemapLayer>;
Objects : Array<Phaser.Physics.Arcade.Sprite>;
map: ITiledMap;
- startX = (window.innerWidth / 2) / RESOLUTION;
- startY = (window.innerHeight / 2) / RESOLUTION;
+ startX = 704;// 22 case
+ startY = 32; // 1 case
constructor() {
video: videoConstraint
};
getCameraPromise : Promise<any> = null;
+ updatedLocalStreamCallBack : Function;
+
+ constructor(updatedLocalStreamCallBack : Function) {
+ this.updatedLocalStreamCallBack = updatedLocalStreamCallBack;
- constructor() {
this.myCamVideo = document.getElementById('myCamVideo');
- this.microphoneClose = document.getElementById('microphone-close');
+ this.microphoneClose = document.getElementById('microphone-close');
+ this.microphoneClose.style.display = "none";
this.microphoneClose.addEventListener('click', (e: any) => {
e.preventDefault();
this.enabledMicrophone();
});
this.cinemaClose = document.getElementById('cinema-close');
+ this.cinemaClose.style.display = "none";
this.cinemaClose.addEventListener('click', (e: any) => {
e.preventDefault();
this.enabledCamera();
this.constraintsMedia.video = videoConstraint;
this.localStream = null;
this.myCamVideo.srcObject = null;
+ this.getCamera().then((stream) => {
+ this.updatedLocalStreamCallBack(stream);
+ });
}
disabledCamera() {
}
this.localStream = null;
this.myCamVideo.srcObject = null;
+ this.getCamera().then((stream) => {
+ this.updatedLocalStreamCallBack(stream);
+ });
}
enabledMicrophone() {
this.microphoneClose.style.display = "none";
this.microphone.style.display = "block";
this.constraintsMedia.audio = true;
+ this.getCamera().then((stream) => {
+ this.updatedLocalStreamCallBack(stream);
+ });
}
disabledMicrophone() {
}
});
}
- }
-
- getElementActivePhone(){
- return document.getElementById('phone-open');
- }
-
- activePhoneOpen(){
- return this.getElementActivePhone().classList.add("active");
- }
-
- disablePhoneOpen(){
- return this.getElementActivePhone().classList.remove("active");
+ this.getCamera().then((stream) => {
+ this.updatedLocalStreamCallBack(stream);
+ });
}
//get camera
constructor(Connexion: ConnexionInterface, WebRtcRoomId: string = "test-webrtc") {
this.Connexion = Connexion;
this.WebRtcRoomId = WebRtcRoomId;
- this.MediaManager = new MediaManager();
+ this.MediaManager = new MediaManager((stream : MediaStream) => {
+ this.updatedLocalStream();
+ });
this.PeerConnexionArray = new Array<any>();
this.initialise();
{
urls: 'turn:numb.viagenie.ca',
username: 'g.parant@thecodingmachine.com',
- credential: 'Muzuvo$6'
+ credential: 'itcugcOHxle9Acqi$'
},
]
},
console.error(`addMedia => addMedia => ${userId}`, e);
}
}
+
+ updatedLocalStream(){
+ this.Users.forEach((user) => {
+ this.addMedia(user.userId);
+ })
+ }
}
\ No newline at end of file