Refactor
This commit is contained in:
parent
91851c95f3
commit
58df4118d1
@ -8,14 +8,14 @@ export interface SimplePeerInterface {
|
|||||||
export class SimplePeer {
|
export class SimplePeer {
|
||||||
Connexion: ConnexionInterface;
|
Connexion: ConnexionInterface;
|
||||||
MediaManager: MediaManager;
|
MediaManager: MediaManager;
|
||||||
RoomId: string;
|
WebRtcRoomId: string;
|
||||||
Users: Array<any>;
|
Users: Array<any>;
|
||||||
|
|
||||||
PeerConnexionArray: Array<any> = new Array<any>();
|
PeerConnexionArray: Array<any> = new Array<any>();
|
||||||
|
|
||||||
constructor(Connexion: ConnexionInterface, roomId: string = "test-webrtc") {
|
constructor(Connexion: ConnexionInterface, WebRtcRoomId: string = "test-webrtc") {
|
||||||
this.Connexion = Connexion;
|
this.Connexion = Connexion;
|
||||||
this.RoomId = roomId;
|
this.WebRtcRoomId = WebRtcRoomId;
|
||||||
this.MediaManager = new MediaManager();
|
this.MediaManager = new MediaManager();
|
||||||
this.initialise();
|
this.initialise();
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ export class SimplePeer {
|
|||||||
*/
|
*/
|
||||||
receiveWebrtcStart(message: string) {
|
receiveWebrtcStart(message: string) {
|
||||||
let data = JSON.parse(message);
|
let data = JSON.parse(message);
|
||||||
this.RoomId = data.roomId;
|
this.WebRtcRoomId = data.roomId;
|
||||||
this.Users = data.clients;
|
this.Users = data.clients;
|
||||||
|
|
||||||
//active button for player
|
//active button for player
|
||||||
@ -108,7 +108,7 @@ export class SimplePeer {
|
|||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
sendWebrtcSignal(data: any, userId : string) {
|
sendWebrtcSignal(data: any, userId : string) {
|
||||||
this.Connexion.sendWebrtcSignal(data, this.RoomId, null, userId);
|
this.Connexion.sendWebrtcSignal(data, this.WebRtcRoomId, null, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user