Merge pull request #115 from thecodingmachine/update-webrtc
Update media webrtc
This commit is contained in:
commit
f8e6d6c94f
@ -15,6 +15,18 @@
|
|||||||
"height":34,
|
"height":34,
|
||||||
"infinite":false,
|
"infinite":false,
|
||||||
"layers":[
|
"layers":[
|
||||||
|
{
|
||||||
|
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
"height":34,
|
"height":34,
|
||||||
@ -140,7 +152,7 @@
|
|||||||
"x":0,
|
"x":0,
|
||||||
"y":0
|
"y":0
|
||||||
}],
|
}],
|
||||||
"nextlayerid":13,
|
"nextlayerid":14,
|
||||||
"nextobjectid":1,
|
"nextobjectid":1,
|
||||||
"orientation":"orthogonal",
|
"orientation":"orthogonal",
|
||||||
"renderorder":"right-down",
|
"renderorder":"right-down",
|
||||||
@ -159,6 +171,60 @@
|
|||||||
"tilecount":256,
|
"tilecount":256,
|
||||||
"tileheight":32,
|
"tileheight":32,
|
||||||
"tiles":[
|
"tiles":[
|
||||||
|
{
|
||||||
|
"id":1,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":2,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":3,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":4,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":5,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":6,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id":7,
|
"id":7,
|
||||||
"properties":[
|
"properties":[
|
||||||
@ -204,6 +270,60 @@
|
|||||||
"value":true
|
"value":true
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id":17,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":18,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":19,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":20,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":21,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":22,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id":23,
|
"id":23,
|
||||||
"properties":[
|
"properties":[
|
||||||
@ -249,6 +369,60 @@
|
|||||||
"value":true
|
"value":true
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id":33,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":34,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":35,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":36,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":37,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":38,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id":39,
|
"id":39,
|
||||||
"properties":[
|
"properties":[
|
||||||
@ -573,6 +747,15 @@
|
|||||||
"value":true
|
"value":true
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id":179,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id":184,
|
"id":184,
|
||||||
"properties":[
|
"properties":[
|
||||||
@ -609,6 +792,15 @@
|
|||||||
"value":true
|
"value":true
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id":195,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id":196,
|
"id":196,
|
||||||
"properties":[
|
"properties":[
|
||||||
@ -636,6 +828,24 @@
|
|||||||
"value":true
|
"value":true
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id":211,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":212,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id":214,
|
"id":214,
|
||||||
"properties":[
|
"properties":[
|
||||||
@ -653,6 +863,24 @@
|
|||||||
"type":"bool",
|
"type":"bool",
|
||||||
"value":true
|
"value":true
|
||||||
}]
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":227,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":228,
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"collides",
|
||||||
|
"type":"bool",
|
||||||
|
"value":true
|
||||||
|
}]
|
||||||
}],
|
}],
|
||||||
"tilewidth":32
|
"tilewidth":32
|
||||||
},
|
},
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
"y":0
|
"y":0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4743, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4795, 4796, 0, 0, 0, 0, 0, 4634, 0, 4782, 4795, 4634, 0, 0, 0, 0, 4665, 0, 4665, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4795, 4796, 0, 0, 0, 0, 4649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4667, 0, 0, 0, 4668, 0, 0, 0, 0, 0, 0, 4666, 0, 4666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4666, 0, 0, 0, 4666, 0, 0, 0, 0, 0, 4666, 0, 4666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
||||||
"height":18,
|
"height":18,
|
||||||
"id":7,
|
"id":7,
|
||||||
"name":"floor",
|
"name":"floor",
|
||||||
|
@ -99,7 +99,7 @@ export class IoSocketController {
|
|||||||
|
|
||||||
let Client = (socket as ExSocketInterface);
|
let Client = (socket as ExSocketInterface);
|
||||||
|
|
||||||
if(Client.roomId === messageUserPosition.roomId){
|
if (Client.roomId === messageUserPosition.roomId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ export class IoSocketController {
|
|||||||
console.error('An error occurred on "user_position" event');
|
console.error('An error occurred on "user_position" event');
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on(SockerIoEvent.WEBRTC_SIGNAL, (message: string) => {
|
socket.on(SockerIoEvent.WEBRTC_SIGNAL, (message: string) => {
|
||||||
let data: any = JSON.parse(message);
|
let data: any = JSON.parse(message);
|
||||||
@ -316,6 +316,7 @@ export class IoSocketController {
|
|||||||
}
|
}
|
||||||
tabs.push({
|
tabs.push({
|
||||||
userId: clientId.userId,
|
userId: clientId.userId,
|
||||||
|
name: clientId.name,
|
||||||
initiator: index <= indexClientId
|
initiator: index <= indexClientId
|
||||||
});
|
});
|
||||||
return tabs;
|
return tabs;
|
||||||
|
7
front/dist/index.html
vendored
7
front/dist/index.html
vendored
@ -13,7 +13,9 @@
|
|||||||
<script src="bundle.js"></script>
|
<script src="bundle.js"></script>
|
||||||
<div id="webRtc" class="webrtc">
|
<div id="webRtc" class="webrtc">
|
||||||
<div id="activeCam" class="activeCam">
|
<div id="activeCam" class="activeCam">
|
||||||
<video id="myCamVideo" autoplay muted></video>
|
<div id="div-myCamVideo" class="video-container">
|
||||||
|
<video id="myCamVideo" autoplay muted></video>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-cam-action">
|
<div class="btn-cam-action">
|
||||||
<div class="btn-micro">
|
<div class="btn-micro">
|
||||||
@ -29,5 +31,8 @@
|
|||||||
</div>-->
|
</div>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<audio id="audio-webrtc-in">
|
||||||
|
<source src="/resources/objects/webrtc-in.mp3" type="audio/mp3">
|
||||||
|
</audio>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
BIN
front/dist/resources/objects/webrtc-in.mp3
vendored
Normal file
BIN
front/dist/resources/objects/webrtc-in.mp3
vendored
Normal file
Binary file not shown.
53
front/dist/resources/style/style.css
vendored
53
front/dist/resources/style/style.css
vendored
@ -37,35 +37,74 @@ video{
|
|||||||
.webrtc.active{
|
.webrtc.active{
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.webrtc, .activeCam{}
|
.webrtc, .activeCam{}
|
||||||
.activeCam video{
|
.activeCam .video-container{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
height: 25%;
|
height: 25%;
|
||||||
top: 10px;
|
top: 10px;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
right: -100px;
|
right: -100px;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
|
border-color: black;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 0.2px;
|
||||||
}
|
}
|
||||||
.webrtc:hover .activeCam video{
|
.activeCam .video-container i{
|
||||||
|
position: absolute;
|
||||||
|
width: 100px;
|
||||||
|
height: 65px;
|
||||||
|
left: calc(50% - 50px);
|
||||||
|
top: calc(50% - 50px);
|
||||||
|
background-color: black;
|
||||||
|
border-radius: 50%;
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 35px;
|
||||||
|
font-size: 28px;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.activeCam .video-container img.active{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.activeCam .video-container img{
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
background: #d93025;
|
||||||
|
border-radius: 48px;
|
||||||
|
left: 5px;
|
||||||
|
bottom: 5px;
|
||||||
|
padding: 10px;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
.activeCam .video-container video{
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.webrtc:hover .activeCam .video-container{
|
||||||
right: 10px;
|
right: 10px;
|
||||||
}
|
}
|
||||||
.activeCam video#myCamVideo{
|
.activeCam .video-container#div-myCamVideo{
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.activeCam .video-container video#myCamVideo{
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 113px;
|
height: 113px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*CSS size for 2 - 3 elements*/
|
/*CSS size for 2 - 3 elements*/
|
||||||
.activeCam video:nth-child(1){
|
.activeCam .video-container:nth-child(1){
|
||||||
/*this is for camera of user*/
|
/*this is for camera of user*/
|
||||||
top: 75%;
|
top: 75%;
|
||||||
}
|
}
|
||||||
.activeCam video:nth-child(2){
|
.activeCam .video-container:nth-child(2){
|
||||||
top: 0%;
|
top: 0%;
|
||||||
}
|
}
|
||||||
.activeCam video:nth-child(3){
|
.activeCam .video-container:nth-child(3){
|
||||||
top: 25%;
|
top: 25%;
|
||||||
}
|
}
|
||||||
.activeCam video:nth-child(4) {
|
.activeCam .video-container:nth-child(4) {
|
||||||
top: 50%;
|
top: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ import {
|
|||||||
} from "../../Connexion";
|
} from "../../Connexion";
|
||||||
import {SimplePeerInterface, SimplePeer} from "../../WebRtc/SimplePeer";
|
import {SimplePeerInterface, SimplePeer} from "../../WebRtc/SimplePeer";
|
||||||
import {getMapKeyByUrl} from "../Login/LogincScene";
|
import {getMapKeyByUrl} from "../Login/LogincScene";
|
||||||
import SceneManager = Phaser.Scenes.SceneManager;
|
|
||||||
import ScenePlugin = Phaser.Scenes.ScenePlugin;
|
import ScenePlugin = Phaser.Scenes.ScenePlugin;
|
||||||
|
|
||||||
export enum StatusGameManagerEnum {
|
export enum StatusGameManagerEnum {
|
||||||
|
@ -11,6 +11,7 @@ export class MediaManager {
|
|||||||
cinema: any = null;
|
cinema: any = null;
|
||||||
microphoneClose: any = null;
|
microphoneClose: any = null;
|
||||||
microphone: any = null;
|
microphone: any = null;
|
||||||
|
webrtcInAudio: any;
|
||||||
constraintsMedia : {audio : any, video : any} = {
|
constraintsMedia : {audio : any, video : any} = {
|
||||||
audio: true,
|
audio: true,
|
||||||
video: videoConstraint
|
video: videoConstraint
|
||||||
@ -22,6 +23,8 @@ export class MediaManager {
|
|||||||
this.updatedLocalStreamCallBack = updatedLocalStreamCallBack;
|
this.updatedLocalStreamCallBack = updatedLocalStreamCallBack;
|
||||||
|
|
||||||
this.myCamVideo = document.getElementById('myCamVideo');
|
this.myCamVideo = document.getElementById('myCamVideo');
|
||||||
|
this.webrtcInAudio = document.getElementById('audio-webrtc-in');
|
||||||
|
this.webrtcInAudio.volume = 0.2;
|
||||||
|
|
||||||
this.microphoneClose = document.getElementById('microphone-close');
|
this.microphoneClose = document.getElementById('microphone-close');
|
||||||
this.microphoneClose.style.display = "none";
|
this.microphoneClose.style.display = "none";
|
||||||
@ -61,8 +64,6 @@ export class MediaManager {
|
|||||||
this.cinemaClose.style.display = "none";
|
this.cinemaClose.style.display = "none";
|
||||||
this.cinema.style.display = "block";
|
this.cinema.style.display = "block";
|
||||||
this.constraintsMedia.video = videoConstraint;
|
this.constraintsMedia.video = videoConstraint;
|
||||||
this.localStream = null;
|
|
||||||
this.myCamVideo.srcObject = null;
|
|
||||||
this.getCamera().then((stream) => {
|
this.getCamera().then((stream) => {
|
||||||
this.updatedLocalStreamCallBack(stream);
|
this.updatedLocalStreamCallBack(stream);
|
||||||
});
|
});
|
||||||
@ -72,17 +73,12 @@ export class MediaManager {
|
|||||||
this.cinemaClose.style.display = "block";
|
this.cinemaClose.style.display = "block";
|
||||||
this.cinema.style.display = "none";
|
this.cinema.style.display = "none";
|
||||||
this.constraintsMedia.video = false;
|
this.constraintsMedia.video = false;
|
||||||
|
this.myCamVideo.srcObject = null;
|
||||||
this.myCamVideo.pause();
|
if (this.localStream) {
|
||||||
if(this.localStream) {
|
this.localStream.getVideoTracks().forEach((MediaStreamTrack: MediaStreamTrack) => {
|
||||||
this.localStream.getTracks().forEach((MediaStreamTrack: MediaStreamTrack) => {
|
MediaStreamTrack.stop();
|
||||||
if (MediaStreamTrack.kind === "video") {
|
|
||||||
MediaStreamTrack.stop();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.localStream = null;
|
|
||||||
this.myCamVideo.srcObject = null;
|
|
||||||
this.getCamera().then((stream) => {
|
this.getCamera().then((stream) => {
|
||||||
this.updatedLocalStreamCallBack(stream);
|
this.updatedLocalStreamCallBack(stream);
|
||||||
});
|
});
|
||||||
@ -102,10 +98,8 @@ export class MediaManager {
|
|||||||
this.microphone.style.display = "none";
|
this.microphone.style.display = "none";
|
||||||
this.constraintsMedia.audio = false;
|
this.constraintsMedia.audio = false;
|
||||||
if(this.localStream) {
|
if(this.localStream) {
|
||||||
this.localStream.getTracks().forEach((MediaStreamTrack: MediaStreamTrack) => {
|
this.localStream.getAudioTracks().forEach((MediaStreamTrack: MediaStreamTrack) => {
|
||||||
if (MediaStreamTrack.kind === "audio") {
|
MediaStreamTrack.stop();
|
||||||
MediaStreamTrack.stop();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.getCamera().then((stream) => {
|
this.getCamera().then((stream) => {
|
||||||
@ -130,9 +124,8 @@ export class MediaManager {
|
|||||||
|
|
||||||
return stream;
|
return stream;
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.error(err);
|
console.info(`error get media {video: ${this.constraintsMedia.video}},{audio: ${this.constraintsMedia.audio}}`,err);
|
||||||
this.localStream = null;
|
this.localStream = null;
|
||||||
throw err;
|
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
promise = Promise.reject(false);
|
promise = Promise.reject(false);
|
||||||
@ -144,12 +137,77 @@ export class MediaManager {
|
|||||||
*
|
*
|
||||||
* @param userId
|
* @param userId
|
||||||
*/
|
*/
|
||||||
addActiveVideo(userId : string){
|
addActiveVideo(userId : string, userName: string = ""){
|
||||||
|
this.webrtcInAudio.play();
|
||||||
let elementRemoteVideo = document.getElementById("activeCam");
|
let elementRemoteVideo = document.getElementById("activeCam");
|
||||||
elementRemoteVideo.insertAdjacentHTML('beforeend', '<video id="'+userId+'" autoplay></video>');
|
userName = userName.toUpperCase();
|
||||||
|
let color = this.getColorByString(userName);
|
||||||
|
elementRemoteVideo.insertAdjacentHTML('beforeend', `
|
||||||
|
<div id="div-${userId}" class="video-container" style="border-color: ${color};">
|
||||||
|
<i style="background-color: ${color};">${userName}</i>
|
||||||
|
<img id="microphone-${userId}" src="resources/logos/microphone-close.svg">
|
||||||
|
<video id="${userId}" autoplay></video>
|
||||||
|
</div>
|
||||||
|
`);
|
||||||
this.remoteVideo[(userId as any)] = document.getElementById(userId);
|
this.remoteVideo[(userId as any)] = document.getElementById(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
*/
|
||||||
|
disabledMicrophoneByUserId(userId: string){
|
||||||
|
let element = document.getElementById(`microphone-${userId}`);
|
||||||
|
if(!element){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
element.classList.add('active')
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
*/
|
||||||
|
enabledMicrophoneByUserId(userId: string){
|
||||||
|
let element = document.getElementById(`microphone-${userId}`);
|
||||||
|
if(!element){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
element.classList.remove('active')
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
*/
|
||||||
|
disabledVideoByUserId(userId: string) {
|
||||||
|
let element = document.getElementById(`${userId}`);
|
||||||
|
if (element) {
|
||||||
|
element.style.opacity = "0";
|
||||||
|
}
|
||||||
|
element = document.getElementById(`div-${userId}`);
|
||||||
|
if (!element) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
element.style.borderStyle = "solid";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
*/
|
||||||
|
enabledVideoByUserId(userId: string){
|
||||||
|
let element = document.getElementById(`${userId}`);
|
||||||
|
if(element){
|
||||||
|
element.style.opacity = "1";
|
||||||
|
}
|
||||||
|
element = document.getElementById(`div-${userId}`);
|
||||||
|
if(!element){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
element.style.borderStyle = "none";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param userId
|
* @param userId
|
||||||
@ -164,10 +222,29 @@ export class MediaManager {
|
|||||||
* @param userId
|
* @param userId
|
||||||
*/
|
*/
|
||||||
removeActiveVideo(userId : string){
|
removeActiveVideo(userId : string){
|
||||||
let element = document.getElementById(userId);
|
let element = document.getElementById(`div-${userId}`);
|
||||||
if(!element){
|
if(!element){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
element.remove();
|
element.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param str
|
||||||
|
*/
|
||||||
|
private getColorByString(str: String) : String|null {
|
||||||
|
let hash = 0;
|
||||||
|
if (str.length === 0) return null;
|
||||||
|
for (let i = 0; i < str.length; i++) {
|
||||||
|
hash = str.charCodeAt(i) + ((hash << 5) - hash);
|
||||||
|
hash = hash & hash;
|
||||||
|
}
|
||||||
|
let color = '#';
|
||||||
|
for (let i = 0; i < 3; i++) {
|
||||||
|
let value = (hash >> (i * 8)) & 255;
|
||||||
|
color += ('00' + value.toString(16)).substr(-2);
|
||||||
|
}
|
||||||
|
return color;
|
||||||
|
}
|
||||||
}
|
}
|
@ -2,17 +2,20 @@ import {ConnexionInterface} from "../Connexion";
|
|||||||
import {MediaManager} from "./MediaManager";
|
import {MediaManager} from "./MediaManager";
|
||||||
let Peer = require('simple-peer');
|
let Peer = require('simple-peer');
|
||||||
|
|
||||||
export interface SimplePeerInterface {
|
class UserSimplePear{
|
||||||
|
userId: string;
|
||||||
|
name?: string;
|
||||||
|
initiator?: boolean;
|
||||||
}
|
}
|
||||||
|
export class SimplePeerInterface {}
|
||||||
export class SimplePeer {
|
export class SimplePeer implements SimplePeerInterface{
|
||||||
private Connexion: ConnexionInterface;
|
private Connexion: ConnexionInterface;
|
||||||
private WebRtcRoomId: string;
|
private WebRtcRoomId: string;
|
||||||
private Users: Array<any>;
|
private Users: Array<UserSimplePear> = new Array<UserSimplePear>();
|
||||||
|
|
||||||
private MediaManager: MediaManager;
|
private MediaManager: MediaManager;
|
||||||
|
|
||||||
private PeerConnexionArray: Array<any> = new Array<any>();
|
private PeerConnexionArray: Map<string, any> = new Map<string, any>();
|
||||||
|
|
||||||
constructor(Connexion: ConnexionInterface, WebRtcRoomId: string = "test-webrtc") {
|
constructor(Connexion: ConnexionInterface, WebRtcRoomId: string = "test-webrtc") {
|
||||||
this.Connexion = Connexion;
|
this.Connexion = Connexion;
|
||||||
@ -20,8 +23,6 @@ export class SimplePeer {
|
|||||||
this.MediaManager = new MediaManager((stream : MediaStream) => {
|
this.MediaManager = new MediaManager((stream : MediaStream) => {
|
||||||
this.updatedLocalStream();
|
this.updatedLocalStream();
|
||||||
});
|
});
|
||||||
this.PeerConnexionArray = new Array<any>();
|
|
||||||
|
|
||||||
this.initialise();
|
this.initialise();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +72,7 @@ export class SimplePeer {
|
|||||||
* server has two person connected, start the meet
|
* server has two person connected, start the meet
|
||||||
*/
|
*/
|
||||||
private startWebRtc() {
|
private startWebRtc() {
|
||||||
this.Users.forEach((user: any) => {
|
this.Users.forEach((user: UserSimplePear) => {
|
||||||
//if it's not an initiator, peer connexion will be created when gamer will receive offer signal
|
//if it's not an initiator, peer connexion will be created when gamer will receive offer signal
|
||||||
if(!user.initiator){
|
if(!user.initiator){
|
||||||
return;
|
return;
|
||||||
@ -83,15 +84,22 @@ export class SimplePeer {
|
|||||||
/**
|
/**
|
||||||
* create peer connexion to bind users
|
* create peer connexion to bind users
|
||||||
*/
|
*/
|
||||||
private createPeerConnexion(user : any) {
|
private createPeerConnexion(user : UserSimplePear) {
|
||||||
if(this.PeerConnexionArray[user.userId]) {
|
if(this.PeerConnexionArray.has(user.userId)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let name = user.name;
|
||||||
|
if(!name){
|
||||||
|
let userSearch = this.Users.find((userSearch: UserSimplePear) => userSearch.userId === user.userId);
|
||||||
|
if(userSearch) {
|
||||||
|
name = userSearch.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.MediaManager.removeActiveVideo(user.userId);
|
this.MediaManager.removeActiveVideo(user.userId);
|
||||||
this.MediaManager.addActiveVideo(user.userId);
|
this.MediaManager.addActiveVideo(user.userId, name);
|
||||||
|
|
||||||
this.PeerConnexionArray[user.userId] = new Peer({
|
let peer : any = new Peer({
|
||||||
initiator: user.initiator ? user.initiator : false,
|
initiator: user.initiator ? user.initiator : false,
|
||||||
reconnectTimer: 10000,
|
reconnectTimer: 10000,
|
||||||
config: {
|
config: {
|
||||||
@ -107,29 +115,51 @@ export class SimplePeer {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
this.PeerConnexionArray.set(user.userId, peer);
|
||||||
|
|
||||||
//start listen signal for the peer connexion
|
//start listen signal for the peer connexion
|
||||||
this.PeerConnexionArray[user.userId].on('signal', (data: any) => {
|
this.PeerConnexionArray.get(user.userId).on('signal', (data: any) => {
|
||||||
this.sendWebrtcSignal(data, user.userId);
|
this.sendWebrtcSignal(data, user.userId);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.PeerConnexionArray[user.userId].on('stream', (stream: MediaStream) => {
|
this.PeerConnexionArray.get(user.userId).on('stream', (stream: MediaStream) => {
|
||||||
|
let videoActive = false;
|
||||||
|
let microphoneActive = false;
|
||||||
|
stream.getTracks().forEach((track : MediaStreamTrack) => {
|
||||||
|
if(track.kind === "audio"){
|
||||||
|
microphoneActive = true;
|
||||||
|
}
|
||||||
|
if(track.kind === "video"){
|
||||||
|
videoActive = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(microphoneActive){
|
||||||
|
this.MediaManager.enabledMicrophoneByUserId(user.userId);
|
||||||
|
}else{
|
||||||
|
this.MediaManager.disabledMicrophoneByUserId(user.userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(videoActive){
|
||||||
|
this.MediaManager.enabledVideoByUserId(user.userId);
|
||||||
|
}else{
|
||||||
|
this.MediaManager.disabledVideoByUserId(user.userId);
|
||||||
|
}
|
||||||
this.stream(user.userId, stream);
|
this.stream(user.userId, stream);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.PeerConnexionArray[user.userId].on('track', (track: MediaStreamTrack, stream: MediaStream) => {
|
this.PeerConnexionArray.get(user.userId).on('track', (track: MediaStreamTrack, stream: MediaStream) => {
|
||||||
this.stream(user.userId, stream);
|
this.stream(user.userId, stream);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.PeerConnexionArray[user.userId].on('close', () => {
|
this.PeerConnexionArray.get(user.userId).on('close', () => {
|
||||||
this.closeConnexion(user.userId);
|
this.closeConnexion(user.userId);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.PeerConnexionArray[user.userId].on('error', (err: any) => {
|
this.PeerConnexionArray.get(user.userId).on('error', (err: any) => {
|
||||||
console.error(`error => ${user.userId} => ${err.code}`, err);
|
console.error(`error => ${user.userId} => ${err.code}`, err);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.PeerConnexionArray[user.userId].on('connect', () => {
|
this.PeerConnexionArray.get(user.userId).on('connect', () => {
|
||||||
console.info(`connect => ${user.userId}`);
|
console.info(`connect => ${user.userId}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -139,13 +169,12 @@ export class SimplePeer {
|
|||||||
private closeConnexion(userId : string) {
|
private closeConnexion(userId : string) {
|
||||||
try {
|
try {
|
||||||
this.MediaManager.removeActiveVideo(userId);
|
this.MediaManager.removeActiveVideo(userId);
|
||||||
if (!this.PeerConnexionArray[(userId as any)]) {
|
if (!this.PeerConnexionArray.get(userId)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.PeerConnexionArray[(userId as any)].destroy();
|
this.PeerConnexionArray.get(userId).destroy();
|
||||||
this.PeerConnexionArray[(userId as any)] = null;
|
this.PeerConnexionArray.delete(userId)
|
||||||
delete this.PeerConnexionArray[(userId as any)];
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("closeConnexion", err)
|
console.error("closeConnexion", err)
|
||||||
}
|
}
|
||||||
@ -175,7 +204,7 @@ export class SimplePeer {
|
|||||||
if(data.signal.type === "offer"){
|
if(data.signal.type === "offer"){
|
||||||
this.createPeerConnexion(data);
|
this.createPeerConnexion(data);
|
||||||
}
|
}
|
||||||
this.PeerConnexionArray[data.userId].signal(data.signal);
|
this.PeerConnexionArray.get(data.userId).signal(data.signal);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(`receiveWebrtcSignal => ${data.userId}`, e);
|
console.error(`receiveWebrtcSignal => ${data.userId}`, e);
|
||||||
}
|
}
|
||||||
@ -197,8 +226,11 @@ export class SimplePeer {
|
|||||||
private addMedia (userId : any = null) {
|
private addMedia (userId : any = null) {
|
||||||
try {
|
try {
|
||||||
let transceiver : any = null;
|
let transceiver : any = null;
|
||||||
|
if(!this.MediaManager.localStream){
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.MediaManager.localStream.getTracks().forEach(
|
this.MediaManager.localStream.getTracks().forEach(
|
||||||
transceiver = (track: MediaStreamTrack) => this.PeerConnexionArray[userId].addTrack(track, this.MediaManager.localStream)
|
transceiver = (track: MediaStreamTrack) => this.PeerConnexionArray.get(userId).addTrack(track, this.MediaManager.localStream)
|
||||||
)
|
)
|
||||||
}catch (e) {
|
}catch (e) {
|
||||||
console.error(`addMedia => addMedia => ${userId}`, e);
|
console.error(`addMedia => addMedia => ${userId}`, e);
|
||||||
@ -206,7 +238,7 @@ export class SimplePeer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updatedLocalStream(){
|
updatedLocalStream(){
|
||||||
this.Users.forEach((user) => {
|
this.Users.forEach((user: UserSimplePear) => {
|
||||||
this.addMedia(user.userId);
|
this.addMedia(user.userId);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user