@reactuses/core 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3441,8 +3441,9 @@ var __async$4 = (__this, __arguments, generator) => {
|
|
|
3441
3441
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
3442
3442
|
});
|
|
3443
3443
|
};
|
|
3444
|
+
const defaultConstints = { audio: true, video: true };
|
|
3444
3445
|
function useMediaDevices(options = {}) {
|
|
3445
|
-
const { requestPermissions, constraints =
|
|
3446
|
+
const { requestPermissions, constraints = defaultConstints } = options;
|
|
3446
3447
|
const [state, setState] = React.useState({ devices: [] });
|
|
3447
3448
|
const isSupported = useSupported(
|
|
3448
3449
|
() => navigator && navigator.mediaDevices && navigator.mediaDevices.enumerateDevices
|
|
@@ -3472,7 +3473,7 @@ function useMediaDevices(options = {}) {
|
|
|
3472
3473
|
if (permissionGranted.current) {
|
|
3473
3474
|
return true;
|
|
3474
3475
|
}
|
|
3475
|
-
let state2
|
|
3476
|
+
let state2;
|
|
3476
3477
|
try {
|
|
3477
3478
|
state2 = (yield navigator.permissions.query({
|
|
3478
3479
|
name: "camera"
|
package/dist/index.mjs
CHANGED
|
@@ -3433,8 +3433,9 @@ var __async$4 = (__this, __arguments, generator) => {
|
|
|
3433
3433
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
3434
3434
|
});
|
|
3435
3435
|
};
|
|
3436
|
+
const defaultConstints = { audio: true, video: true };
|
|
3436
3437
|
function useMediaDevices(options = {}) {
|
|
3437
|
-
const { requestPermissions, constraints =
|
|
3438
|
+
const { requestPermissions, constraints = defaultConstints } = options;
|
|
3438
3439
|
const [state, setState] = useState({ devices: [] });
|
|
3439
3440
|
const isSupported = useSupported(
|
|
3440
3441
|
() => navigator && navigator.mediaDevices && navigator.mediaDevices.enumerateDevices
|
|
@@ -3464,7 +3465,7 @@ function useMediaDevices(options = {}) {
|
|
|
3464
3465
|
if (permissionGranted.current) {
|
|
3465
3466
|
return true;
|
|
3466
3467
|
}
|
|
3467
|
-
let state2
|
|
3468
|
+
let state2;
|
|
3468
3469
|
try {
|
|
3469
3470
|
state2 = (yield navigator.permissions.query({
|
|
3470
3471
|
name: "camera"
|