Fixing screensharing Coturn credentials
When screensharing is initiated by the user, we previously did not send the correct Coturn credentials. We now send the last credentials received from the Video stream.
This commit is contained in:
parent
6b00355ea8
commit
13a20a0ef0
@ -42,6 +42,8 @@ export class SimplePeer {
|
|||||||
private readonly stopLocalScreenSharingStreamCallback: StopScreenSharingCallback;
|
private readonly stopLocalScreenSharingStreamCallback: StopScreenSharingCallback;
|
||||||
private readonly peerConnectionListeners: Array<PeerConnectionListener> = new Array<PeerConnectionListener>();
|
private readonly peerConnectionListeners: Array<PeerConnectionListener> = new Array<PeerConnectionListener>();
|
||||||
private readonly userId: number;
|
private readonly userId: number;
|
||||||
|
private lastWebrtcUserName: string|undefined;
|
||||||
|
private lastWebrtcPassword: string|undefined;
|
||||||
|
|
||||||
constructor(private Connection: RoomConnection, private enableReporting: boolean, private myName: string) {
|
constructor(private Connection: RoomConnection, private enableReporting: boolean, private myName: string) {
|
||||||
// We need to go through this weird bound function pointer in order to be able to "free" this reference later.
|
// We need to go through this weird bound function pointer in order to be able to "free" this reference later.
|
||||||
@ -142,6 +144,9 @@ export class SimplePeer {
|
|||||||
|
|
||||||
mediaManager.addActiveVideo(user, name);
|
mediaManager.addActiveVideo(user, name);
|
||||||
|
|
||||||
|
this.lastWebrtcUserName = user.webRtcUser;
|
||||||
|
this.lastWebrtcPassword = user.webRtcPassword;
|
||||||
|
|
||||||
const peer = new VideoPeer(user, user.initiator ? user.initiator : false, this.Connection);
|
const peer = new VideoPeer(user, user.initiator ? user.initiator : false, this.Connection);
|
||||||
|
|
||||||
//permit to send message
|
//permit to send message
|
||||||
@ -191,6 +196,12 @@ export class SimplePeer {
|
|||||||
mediaManager.addScreenSharingActiveVideo("" + user.userId);
|
mediaManager.addScreenSharingActiveVideo("" + user.userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Enrich the user with last known credentials (if they are not set in the user object, which happens when a user triggers the screen sharing)
|
||||||
|
if (user.webRtcUser === undefined) {
|
||||||
|
user.webRtcUser = this.lastWebrtcUserName;
|
||||||
|
user.webRtcPassword = this.lastWebrtcPassword;
|
||||||
|
}
|
||||||
|
|
||||||
const peer = new ScreenSharingPeer(user, user.initiator ? user.initiator : false, this.Connection);
|
const peer = new ScreenSharingPeer(user, user.initiator ? user.initiator : false, this.Connection);
|
||||||
this.PeerScreenSharingConnectionArray.set(user.userId, peer);
|
this.PeerScreenSharingConnectionArray.set(user.userId, peer);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user