Merge pull request #108 from thecodingmachine/bugFixes
fixed a game crash on firefox on http
This commit is contained in:
commit
4cd2141785
@ -115,7 +115,9 @@ export class MediaManager {
|
||||
|
||||
//get camera
|
||||
getCamera() {
|
||||
return this.getCameraPromise = navigator.mediaDevices.getUserMedia(this.constraintsMedia)
|
||||
let promise = null;
|
||||
try {
|
||||
promise = navigator.mediaDevices.getUserMedia(this.constraintsMedia)
|
||||
.then((stream: MediaStream) => {
|
||||
this.localStream = stream;
|
||||
this.myCamVideo.srcObject = this.localStream;
|
||||
@ -132,6 +134,10 @@ export class MediaManager {
|
||||
this.localStream = null;
|
||||
throw err;
|
||||
});
|
||||
} catch (e) {
|
||||
promise = Promise.reject(false);
|
||||
}
|
||||
return this.getCameraPromise = promise;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user