Fix CI
This commit is contained in:
parent
eed5333d69
commit
6c1b8122ef
@ -294,23 +294,13 @@ export class SimplePeer {
|
||||
try {
|
||||
let localStream: MediaStream | null = mediaManager.localStream;
|
||||
let localScreenCapture: MediaStream | null = mediaManager.localScreenCapture;
|
||||
let PeerConnection : any = this.PeerConnectionArray.get(userId);
|
||||
if (PeerConnection === undefined) {
|
||||
let PeerConnection = this.PeerConnectionArray.get(userId);
|
||||
|
||||
if (!PeerConnection || PeerConnection === undefined) {
|
||||
throw new Error('While adding media, cannot find user with ID ' + userId);
|
||||
}
|
||||
PeerConnection.write(new Buffer(JSON.stringify(Object.assign(mediaManager.constraintsMedia, {screen: localScreenCapture !== null}))));
|
||||
|
||||
//remove current stream
|
||||
try {
|
||||
if (PeerConnection._pc) {
|
||||
PeerConnection._pc.getRemoteStreams().forEach((stream: MediaStream) => {
|
||||
stream.getTracks().forEach((track: MediaStreamTrack) => {
|
||||
PeerConnection.removeTrack(track, stream);
|
||||
});
|
||||
});
|
||||
}
|
||||
}catch (e) {}
|
||||
|
||||
if (localScreenCapture !== null) {
|
||||
for (const track of localScreenCapture.getTracks()) {
|
||||
PeerConnection.addTrack(track, localScreenCapture);
|
||||
|
Loading…
Reference in New Issue
Block a user