Skip to content

Commit 390f6d6

Browse files
committed
Revert "fix(@init): capabilities empty on some devices"
This reverts commit 7986394.
1 parent 7986394 commit 390f6d6

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/misc/camera.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import adapterFactory from "webrtc-adapter/src/js/adapter_factory.js";
22
import { StreamApiNotSupportedError, InsecureContextError } from "./errors.js";
33
import { imageDataFromVideo } from "./image-data.js";
4-
import { eventOn, timeout } from "callforth";
4+
import { eventOn } from "callforth";
55

66
class Camera {
77
constructor(videoEl, stream) {
@@ -19,12 +19,11 @@ class Camera {
1919

2020
getCapabilities() {
2121
const [track] = this.stream.getVideoTracks();
22+
2223
return track.getCapabilities();
2324
}
2425
}
2526

26-
const isEmptyObject = object => Object.keys(object).length === 0;
27-
2827
const INSECURE_CONTEXT = window.isSecureContext !== true;
2928

3029
const STREAM_API_NOT_SUPPORTED = !(
@@ -81,10 +80,5 @@ export default async function(constraints, videoEl, advancedConstraints) {
8180
}
8281
}
8382

84-
// According to: https://oberhofer.co/mediastreamtrack-and-its-capabilities/#queryingcapabilities
85-
// On some devices, getCapabilities only returns a non-empty object after
86-
// some delay. There is no appropriate event so we have to add a constant timeout
87-
await timeout(500);
88-
8983
return new Camera(videoEl, stream);
9084
}

0 commit comments

Comments
 (0)