@stream-io/video-client 0.4.7 → 0.4.9
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/CHANGELOG.md +14 -0
- package/dist/index.browser.es.js +7 -4
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +7 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +7 -4
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Call.ts +2 -2
- package/src/__tests__/server-side/call-types.test.ts +1 -1
- package/src/devices/InputMediaDeviceManagerState.ts +9 -1
- package/src/devices/__tests__/InputMediaDeviceManagerState.test.ts +11 -0
package/package.json
CHANGED
package/src/Call.ts
CHANGED
|
@@ -345,7 +345,7 @@ export class Call {
|
|
|
345
345
|
.catch((err) =>
|
|
346
346
|
this.logger(
|
|
347
347
|
'error',
|
|
348
|
-
`Error disabling camera after
|
|
348
|
+
`Error disabling camera after permission revoked`,
|
|
349
349
|
err,
|
|
350
350
|
),
|
|
351
351
|
);
|
|
@@ -359,7 +359,7 @@ export class Call {
|
|
|
359
359
|
.catch((err) =>
|
|
360
360
|
this.logger(
|
|
361
361
|
'error',
|
|
362
|
-
`Error disabling microphone after
|
|
362
|
+
`Error disabling microphone after permission revoked`,
|
|
363
363
|
err,
|
|
364
364
|
),
|
|
365
365
|
);
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
const apiKey = process.env.STREAM_API_KEY!;
|
|
12
12
|
const secret = process.env.STREAM_SECRET!;
|
|
13
13
|
|
|
14
|
-
describe('call types CRUD API', () => {
|
|
14
|
+
describe.skip('call types CRUD API', () => {
|
|
15
15
|
let client: StreamVideoServerClient;
|
|
16
16
|
const callTypeName = `calltype${generateUUIDv4()}`;
|
|
17
17
|
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from 'rxjs';
|
|
7
7
|
import { isReactNative } from '../helpers/platforms';
|
|
8
8
|
import { RxUtils } from '../store';
|
|
9
|
+
import { getLogger } from '../logger';
|
|
9
10
|
|
|
10
11
|
export type InputDeviceStatus = 'enabled' | 'disabled' | undefined;
|
|
11
12
|
|
|
@@ -55,7 +56,14 @@ export abstract class InputMediaDeviceManagerState<C = MediaTrackConstraints> {
|
|
|
55
56
|
*/
|
|
56
57
|
hasBrowserPermission$ = new Observable<boolean>((subscriber) => {
|
|
57
58
|
const notifyGranted = () => subscriber.next(true);
|
|
58
|
-
|
|
59
|
+
const permissionsAPIAvailable = !!navigator?.permissions?.query;
|
|
60
|
+
if (isReactNative() || !this.permissionName || !permissionsAPIAvailable) {
|
|
61
|
+
getLogger(['devices'])(
|
|
62
|
+
'warn',
|
|
63
|
+
`Permissions can't be queried. Assuming granted.`,
|
|
64
|
+
);
|
|
65
|
+
return notifyGranted();
|
|
66
|
+
}
|
|
59
67
|
|
|
60
68
|
let permissionState: PermissionStatus;
|
|
61
69
|
const notify = () => subscriber.next(permissionState.state === 'granted');
|
|
@@ -84,5 +84,16 @@ describe('InputMediaDeviceManagerState', () => {
|
|
|
84
84
|
expect(hasPermission).toBe(true);
|
|
85
85
|
expect(query).toHaveBeenCalledWith({ name: 'camera' });
|
|
86
86
|
});
|
|
87
|
+
|
|
88
|
+
it('should emit true when permissions API is unavailable', async () => {
|
|
89
|
+
globalThis.navigator ??= {} as Navigator;
|
|
90
|
+
// @ts-ignore - navigator is readonly, but we need to mock it
|
|
91
|
+
globalThis.navigator.permissions = null;
|
|
92
|
+
|
|
93
|
+
const hasPermission = await new Promise((resolve) => {
|
|
94
|
+
state.hasBrowserPermission$.subscribe((v) => resolve(v));
|
|
95
|
+
});
|
|
96
|
+
expect(hasPermission).toBe(true);
|
|
97
|
+
});
|
|
87
98
|
});
|
|
88
99
|
});
|