Commit a1f2151c by Christoph

Fixed an error that was triggered if a call was destroyed immediately after a…

Fixed an error that was triggered if a call was destroyed immediately after a video stream was created but before the video actually started + fixed swapped audio / video toggles in the examples
parent 3a88e44c
...@@ -40,7 +40,7 @@ class CallApp { ...@@ -40,7 +40,7 @@ class CallApp {
this.Stop(); this.Stop();
} }
else { else {
this.Start(this.mAddress, this.mVideo, this.mAudio); this.Start(this.mAddress, this.mAudio, this.mVideo);
} }
}; };
this.OnUiUpdate = () => { this.OnUiUpdate = () => {
......
...@@ -165,7 +165,7 @@ export class CallApp ...@@ -165,7 +165,7 @@ export class CallApp
this.Stop(); this.Stop();
}else{ }else{
this.Start(this.mAddress, this.mVideo , this.mAudio ); this.Start(this.mAddress, this.mAudio, this.mVideo);
} }
} }
......
...@@ -139,6 +139,10 @@ export class BrowserMediaStream { ...@@ -139,6 +139,10 @@ export class BrowserMediaStream {
SLog.L("video element created. video tracks: " + this.mStream.getVideoTracks().length); SLog.L("video element created. video tracks: " + this.mStream.getVideoTracks().length);
this.mVideoElement.onloadedmetadata = (e) => { this.mVideoElement.onloadedmetadata = (e) => {
//we might have shutdown everything by now already
if(this.mVideoElement == null)
return;
this.mVideoElement.play(); this.mVideoElement.play();
if(this.InternalStreamAdded != null) if(this.InternalStreamAdded != null)
this.InternalStreamAdded(this); this.InternalStreamAdded(this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment