@signalwire/js 3.13.0 → 3.13.1
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/core/src/BaseConsumer.d.ts.map +1 -1
- package/dist/core/src/pubSub/BasePubSub.d.ts +1 -0
- package/dist/core/src/pubSub/BasePubSub.d.ts.map +1 -1
- package/dist/core/src/testUtils.d.ts +36 -0
- package/dist/core/src/testUtils.d.ts.map +1 -1
- package/dist/core/src/utils/index.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/js/tsconfig.build.tsbuildinfo +1 -1
- package/dist/webrtc/src/index.d.ts +2 -2
- package/dist/webrtc/src/index.d.ts.map +1 -1
- package/dist/webrtc/src/utils/deviceHelpers.d.ts +1 -72
- package/dist/webrtc/src/utils/deviceHelpers.d.ts.map +1 -1
- package/dist/webrtc/src/utils/enumerateDevices.d.ts +25 -0
- package/dist/webrtc/src/utils/enumerateDevices.d.ts.map +1 -0
- package/dist/webrtc/src/utils/getDisplayMedia.d.ts +17 -0
- package/dist/webrtc/src/utils/getDisplayMedia.d.ts.map +1 -0
- package/dist/webrtc/src/utils/getUserMedia.d.ts +35 -0
- package/dist/webrtc/src/utils/getUserMedia.d.ts.map +1 -0
- package/dist/webrtc/src/utils/helpers.d.ts.map +1 -1
- package/dist/webrtc/src/utils/index.d.ts +7 -0
- package/dist/webrtc/src/utils/index.d.ts.map +1 -0
- package/dist/webrtc/src/utils/permissions.d.ts +48 -0
- package/dist/webrtc/src/utils/permissions.d.ts.map +1 -0
- package/dist/webrtc/src/utils/primitives.d.ts +54 -0
- package/dist/webrtc/src/utils/primitives.d.ts.map +1 -0
- package/dist/webrtc/src/utils/primitives.native.d.ts +35 -0
- package/dist/webrtc/src/utils/primitives.native.d.ts.map +1 -0
- package/dist/webrtc/src/utils/requestPermissions.d.ts +27 -0
- package/dist/webrtc/src/utils/requestPermissions.d.ts.map +1 -0
- package/package.json +3 -3
- package/dist/webrtc/src/utils/webrtcHelpers.d.ts +0 -136
- package/dist/webrtc/src/utils/webrtcHelpers.d.ts.map +0 -1
- package/dist/webrtc/src/utils/webrtcHelpers.native.d.ts +0 -14
- package/dist/webrtc/src/utils/webrtcHelpers.native.d.ts.map +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompts the user to share one or more media devices and asynchronously
|
|
3
|
+
* returns an associated [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream)
|
|
4
|
+
* object.
|
|
5
|
+
*
|
|
6
|
+
* For more information, see [`MediaDevices.getUserMedia()`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia).
|
|
7
|
+
*
|
|
8
|
+
* @param constraints an optional [MediaStreamConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints)
|
|
9
|
+
* object specifying requirements for the returned [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* To only request audio media:
|
|
13
|
+
*
|
|
14
|
+
* ```typescript
|
|
15
|
+
* await SignalWire.WebRTC.getUserMedia({audio: true, video: false})
|
|
16
|
+
* // MediaStream {id: "HCXy...", active: true, ...}
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* To request both audio and video, specifying constraints for the video:
|
|
21
|
+
*
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const constraints = {
|
|
24
|
+
* audio: true,
|
|
25
|
+
* video: {
|
|
26
|
+
* width: { min: 1024, ideal: 1280, max: 1920 },
|
|
27
|
+
* height: { min: 576, ideal: 720, max: 1080 }
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
* await SignalWire.WebRTC.getUserMedia(constraints)
|
|
31
|
+
* // MediaStream {id: "EDVk...", active: true, ...}
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare const getUserMedia: (constraints?: MediaStreamConstraints) => Promise<MediaStream>;
|
|
35
|
+
//# sourceMappingURL=getUserMedia.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserMedia.d.ts","sourceRoot":"","sources":["../../../../../webrtc/src/utils/getUserMedia.ts"],"names":[],"mappings":"AAoCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,YAAY,iBACV,sBAAsB,yBAuEpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../webrtc/src/utils/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../webrtc/src/utils/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAGhD,eAAO,MAAM,YAAY,gBAAiB,sBAAsB,qCAQ/D,CAAA;AAED,eAAO,MAAM,mBAAmB,YACrB,iBAAiB,KACzB,QAAQ,sBAAsB,CA8BhC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../webrtc/src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
declare type DevicePermissionName = 'camera' | 'microphone' | 'speaker';
|
|
2
|
+
/**
|
|
3
|
+
* Asynchronously returns whether we have permissions to access the specified
|
|
4
|
+
* resource. Some common parameter values for `name` are `"camera"`,
|
|
5
|
+
* `"microphone"`, and `"speaker"`. In those cases, prefer the dedicated methods
|
|
6
|
+
* {@link checkCameraPermissions}, {@link checkMicrophonePermissions}, and
|
|
7
|
+
* {@link checkSpeakerPermissions}.
|
|
8
|
+
* @param name name of the resource
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* await SignalWire.WebRTC.checkPermissions("camera")
|
|
13
|
+
* // true: we have permission for using the camera
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const checkPermissions: (name?: DevicePermissionName | undefined) => Promise<boolean | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Asynchronously returns whether we have permissions to access the camera.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* await SignalWire.WebRTC.checkCameraPermissions()
|
|
23
|
+
* // true
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const checkCameraPermissions: () => Promise<boolean | null>;
|
|
27
|
+
/**
|
|
28
|
+
* Asynchronously returns whether we have permissions to access the microphone.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* await SignalWire.WebRTC.checkMicrophonePermissions()
|
|
33
|
+
* // true
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const checkMicrophonePermissions: () => Promise<boolean | null>;
|
|
37
|
+
/**
|
|
38
|
+
* Asynchronously returns whether we have permissions to access the speakers.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* await SignalWire.WebRTC.checkSpeakerPermissions()
|
|
43
|
+
* // true
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare const checkSpeakerPermissions: () => Promise<boolean | null>;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../../../webrtc/src/utils/permissions.ts"],"names":[],"mappings":"AAmBA,aAAK,oBAAoB,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAA;AAE/D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,sEAoB5B,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,+BAAmC,CAAA;AAEtE;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,+BAAuC,CAAA;AAE9E;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,+BAAoC,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const RTCPeerConnection: (config: RTCConfiguration) => RTCPeerConnection;
|
|
2
|
+
/**
|
|
3
|
+
* Returns whether the current environment supports the media devices API.
|
|
4
|
+
*/
|
|
5
|
+
export declare const supportsMediaDevices: () => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the mediaDevices object if supported, otherwise throws an error.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getMediaDevicesApi: () => MediaDevices;
|
|
10
|
+
/**
|
|
11
|
+
* Returns whether the current environment supports `getUserMedia`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const supportsGetUserMedia: () => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Returns whether the current environment supports `getDisplayMedia`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const supportsGetDisplayMedia: () => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Returns a dictionary whose fields specify the constrainable properties the user agent understands.
|
|
20
|
+
*/
|
|
21
|
+
export declare const getSupportedConstraints: () => MediaTrackSupportedConstraints;
|
|
22
|
+
export declare const streamIsValid: (stream?: MediaStream | undefined) => boolean | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Returns whether the current environment supports the selection of a media output device.
|
|
25
|
+
*/
|
|
26
|
+
export declare const supportsMediaOutput: () => boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Assigns the specified audio output device to the specified HTMLMediaElement.
|
|
29
|
+
* The device with id `deviceId` must be an audio output device. Asynchronously
|
|
30
|
+
* returns whether the operation had success.
|
|
31
|
+
*
|
|
32
|
+
* > 📘
|
|
33
|
+
* > Some browsers do not support output device selection. You can check by
|
|
34
|
+
* > calling [`supportsMediaOutput`](supportsmediaoutput).
|
|
35
|
+
*
|
|
36
|
+
* @param el target element
|
|
37
|
+
* @param deviceId id of the audio output device
|
|
38
|
+
* @returns a promise of whether the operation had success
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const el = document.querySelector('video')
|
|
43
|
+
* const outDevices = await SignalWire.WebRTC.getSpeakerDevicesWithPermissions()
|
|
44
|
+
* await SignalWire.WebRTC.setMediaElementSinkId(el, outDevices[0].deviceId)
|
|
45
|
+
* // true
|
|
46
|
+
```
|
|
47
|
+
*/
|
|
48
|
+
export declare const setMediaElementSinkId: (el: HTMLMediaElement | null, deviceId: string) => Promise<undefined>;
|
|
49
|
+
export declare const sdpToJsonHack: (sdp: any) => any;
|
|
50
|
+
export declare const stopStream: (stream?: MediaStream | undefined) => void;
|
|
51
|
+
export declare const stopTrack: (track: MediaStreamTrack) => void;
|
|
52
|
+
export declare type DevicePermissionName = 'camera' | 'microphone' | 'speaker';
|
|
53
|
+
export declare const _getMediaDeviceKindByName: (name?: DevicePermissionName | undefined) => MediaDeviceKind | undefined;
|
|
54
|
+
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../../webrtc/src/utils/primitives.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,WAAY,gBAAgB,sBAEzD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAEhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,oBAM9B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAEhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,eAEnC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,sCAEnC,CAAA;AAED,eAAO,MAAM,aAAa,2DACe,CAAA;AAEzC;;GAEG;AACH,eAAO,MAAM,mBAAmB,eAE/B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,qBAAqB,OAC5B,gBAAgB,GAAG,IAAI,YACjB,MAAM,KACf,QAAQ,SAAS,CAyBnB,CAAA;AAED,eAAO,MAAM,aAAa,QAAS,GAAG,QAAQ,CAAA;AAE9C,eAAO,MAAM,UAAU,4CAItB,CAAA;AAED,eAAO,MAAM,SAAS,UAAW,gBAAgB,SAKhD,CAAA;AAGD,oBAAY,oBAAoB,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAA;AAYtE,eAAO,MAAM,yBAAyB,0EAMrC,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const RTCPeerConnection: (config: RTCConfiguration) => any;
|
|
2
|
+
/**
|
|
3
|
+
* Returns whether the current environment supports the media devices API.
|
|
4
|
+
*/
|
|
5
|
+
export declare const supportsMediaDevices: () => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the mediaDevices object if supported, otherwise throws an error.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getMediaDevicesApi: () => any;
|
|
10
|
+
/**
|
|
11
|
+
* Returns whether the current environment supports `getUserMedia`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const supportsGetUserMedia: () => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Returns whether the current environment supports `getDisplayMedia`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const supportsGetDisplayMedia: () => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Returns a dictionary whose fields specify the constrainable properties the user agent understands.
|
|
20
|
+
* Not supported on React Native
|
|
21
|
+
*/
|
|
22
|
+
export declare const getSupportedConstraints: () => {};
|
|
23
|
+
export declare const streamIsValid: (stream: RNMediaStream) => any;
|
|
24
|
+
/**
|
|
25
|
+
* Returns whether the current environment supports the selection of a media output device.
|
|
26
|
+
* Not supported in React Native.
|
|
27
|
+
*/
|
|
28
|
+
export declare const supportsMediaOutput: () => boolean;
|
|
29
|
+
export declare const setMediaElementSinkId: (_htmlElementId: string, _deviceId: string) => Promise<boolean>;
|
|
30
|
+
export declare const sdpToJsonHack: (sdp: any) => any;
|
|
31
|
+
export declare const stopStream: (stream: RNMediaStream) => void;
|
|
32
|
+
export declare const stopTrack: (track: MediaStreamTrack) => void;
|
|
33
|
+
export declare type DevicePermissionName = 'camera' | 'microphone' | 'speaker';
|
|
34
|
+
export declare const _getMediaDeviceKindByName: (name?: DevicePermissionName | undefined) => MediaDeviceKind | undefined;
|
|
35
|
+
//# sourceMappingURL=primitives.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.native.d.ts","sourceRoot":"","sources":["../../../../../webrtc/src/utils/primitives.native.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,iBAAiB,WAAY,gBAAgB,QAGzD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAEhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,WAM9B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAEhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,eAEnC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,UAAa,CAAA;AAEjD,eAAO,MAAM,aAAa,gCACiB,CAAA;AAE3C;;;GAGG;AACH,eAAO,MAAM,mBAAmB,eAE/B,CAAA;AAED,eAAO,MAAM,qBAAqB,mBAChB,MAAM,aACX,MAAM,KAChB,QAAQ,OAAO,CAA2B,CAAA;AAE7C,eAAO,MAAM,aAAa,QAAS,GAAG,QAGrC,CAAA;AAED,eAAO,MAAM,UAAU,iCAKtB,CAAA;AAkBD,eAAO,MAAM,SAAS,UAAW,gBAAgB,SAQhD,CAAA;AAGD,oBAAY,oBAAoB,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAA;AAYtE,eAAO,MAAM,yBAAyB,0EAMrC,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompts the user to grant permissions for the devices matching the specified set of constraints.
|
|
3
|
+
* @param constraints an optional [MediaStreamConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints)
|
|
4
|
+
* object specifying requirements for the returned [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream).
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* To only request audio permissions:
|
|
8
|
+
*
|
|
9
|
+
* ```typescript
|
|
10
|
+
* await SignalWire.WebRTC.requestPermissions({audio: true, video: false})
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* To request permissions for both audio and video, specifying constraints for the video:
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const constraints = {
|
|
17
|
+
* audio: true,
|
|
18
|
+
* video: {
|
|
19
|
+
* width: { min: 1024, ideal: 1280, max: 1920 },
|
|
20
|
+
* height: { min: 576, ideal: 720, max: 1080 }
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
* await SignalWire.WebRTC.requestPermissions(constraints)
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const requestPermissions: (constraints: MediaStreamConstraints) => Promise<void>;
|
|
27
|
+
//# sourceMappingURL=requestPermissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestPermissions.d.ts","sourceRoot":"","sources":["../../../../../webrtc/src/utils/requestPermissions.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,kBAAkB,gBAChB,sBAAsB,kBAQpC,CAAA"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "SignalWire JS SDK",
|
|
4
4
|
"author": "SignalWire Team <open.source@signalwire.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "3.13.
|
|
6
|
+
"version": "3.13.1",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.esm.js",
|
|
9
9
|
"unpkg": "dist/index.umd.js",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"prepublishOnly": "npm run build"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@signalwire/core": "3.10.
|
|
47
|
-
"@signalwire/webrtc": "3.5.
|
|
46
|
+
"@signalwire/core": "3.10.1",
|
|
47
|
+
"@signalwire/webrtc": "3.5.5",
|
|
48
48
|
"jwt-decode": "^3.1.2"
|
|
49
49
|
},
|
|
50
50
|
"types": "dist/js/src/index.d.ts"
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
export declare const RTCPeerConnection: (config: RTCConfiguration) => RTCPeerConnection;
|
|
2
|
-
/**
|
|
3
|
-
* Returns whether the current environment supports the media devices API.
|
|
4
|
-
*/
|
|
5
|
-
export declare const supportsMediaDevices: () => boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Returns whether the current environment supports `getUserMedia`.
|
|
8
|
-
*/
|
|
9
|
-
export declare const supportsGetUserMedia: () => boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Returns whether the current environment supports `getDisplayMedia`.
|
|
12
|
-
*/
|
|
13
|
-
export declare const supportsGetDisplayMedia: () => boolean;
|
|
14
|
-
export declare const getMediaDevicesApi: () => MediaDevices;
|
|
15
|
-
/**
|
|
16
|
-
* Prompts the user to share one or more media devices and asynchronously
|
|
17
|
-
* returns an associated [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream)
|
|
18
|
-
* object.
|
|
19
|
-
*
|
|
20
|
-
* For more information, see [`MediaDevices.getUserMedia()`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia).
|
|
21
|
-
*
|
|
22
|
-
* @param constraints an optional [MediaStreamConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints)
|
|
23
|
-
* object specifying requirements for the returned [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream).
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* To only request audio media:
|
|
27
|
-
*
|
|
28
|
-
* ```typescript
|
|
29
|
-
* await SignalWire.WebRTC.getUserMedia({audio: true, video: false})
|
|
30
|
-
* // MediaStream {id: "HCXy...", active: true, ...}
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* To request both audio and video, specifying constraints for the video:
|
|
35
|
-
*
|
|
36
|
-
* ```typescript
|
|
37
|
-
* const constraints = {
|
|
38
|
-
* audio: true,
|
|
39
|
-
* video: {
|
|
40
|
-
* width: { min: 1024, ideal: 1280, max: 1920 },
|
|
41
|
-
* height: { min: 576, ideal: 720, max: 1080 }
|
|
42
|
-
* }
|
|
43
|
-
* }
|
|
44
|
-
* await SignalWire.WebRTC.getUserMedia(constraints)
|
|
45
|
-
* // MediaStream {id: "EDVk...", active: true, ...}
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
export declare const getUserMedia: (constraints?: MediaStreamConstraints) => Promise<MediaStream>;
|
|
49
|
-
/**
|
|
50
|
-
* Prompts the user to share the screen and asynchronously returns a
|
|
51
|
-
* [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream)
|
|
52
|
-
* object associated with a display or part of it.
|
|
53
|
-
*
|
|
54
|
-
* @param constraints an optional
|
|
55
|
-
* [MediaStreamConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints)
|
|
56
|
-
* object specifying requirements for the returned [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream).
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```typescript
|
|
60
|
-
* await SignalWire.WebRTC.getDisplayMedia()
|
|
61
|
-
* // MediaStream {id: "HCXy...", active: true, ...}
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
export declare const getDisplayMedia: (constraints?: MediaStreamConstraints | undefined) => Promise<MediaStream>;
|
|
65
|
-
/**
|
|
66
|
-
* Enumerates the media input and output devices available on this device.
|
|
67
|
-
*
|
|
68
|
-
* > 📘
|
|
69
|
-
* > Depending on the browser, some information (such as the `label` and
|
|
70
|
-
* > `deviceId` attributes) could be hidden until permission is granted, for
|
|
71
|
-
* > example by calling {@link getUserMedia}.
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```typescript
|
|
75
|
-
* await SignalWire.WebRTC.enumerateDevices()
|
|
76
|
-
* // [
|
|
77
|
-
* // {
|
|
78
|
-
* // "deviceId": "Rug5Bk...4TMhY=",
|
|
79
|
-
* // "kind": "videoinput",
|
|
80
|
-
* // "label": "HD FaceTime Camera",
|
|
81
|
-
* // "groupId": "EEX/N2...AjrOs="
|
|
82
|
-
* // },
|
|
83
|
-
* // ...
|
|
84
|
-
* // ]
|
|
85
|
-
* ```
|
|
86
|
-
*/
|
|
87
|
-
export declare const enumerateDevices: () => Promise<MediaDeviceInfo[]>;
|
|
88
|
-
export declare const enumerateDevicesByKind: (filterByKind?: MediaDeviceKind | undefined) => Promise<MediaDeviceInfo[]>;
|
|
89
|
-
/**
|
|
90
|
-
* Returns a dictionary whose fields specify the constrainable properties the user agent understands.
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* ```typescript
|
|
94
|
-
* SignalWire.WebRTC.getSupportedConstraints()
|
|
95
|
-
* // {
|
|
96
|
-
* // "aspectRatio": true,
|
|
97
|
-
* // "autoGainControl": true,
|
|
98
|
-
* // "brightness": true,
|
|
99
|
-
* // "channelCount": true,
|
|
100
|
-
* // "colorTemperature": true,
|
|
101
|
-
* // ...
|
|
102
|
-
* // }
|
|
103
|
-
* ```
|
|
104
|
-
*/
|
|
105
|
-
export declare const getSupportedConstraints: () => MediaTrackSupportedConstraints;
|
|
106
|
-
export declare const streamIsValid: (stream?: MediaStream | undefined) => boolean | undefined;
|
|
107
|
-
/**
|
|
108
|
-
* Returns whether the current environment supports the selection of a media output device.
|
|
109
|
-
*/
|
|
110
|
-
export declare const supportsMediaOutput: () => boolean;
|
|
111
|
-
/**
|
|
112
|
-
* Assigns the specified audio output device to the specified HTMLMediaElement.
|
|
113
|
-
* The device with id `deviceId` must be an audio output device. Asynchronously
|
|
114
|
-
* returns whether the operation had success.
|
|
115
|
-
*
|
|
116
|
-
* > 📘
|
|
117
|
-
* > Some browsers do not support output device selection. You can check by
|
|
118
|
-
* > calling [`supportsMediaOutput`](supportsmediaoutput).
|
|
119
|
-
*
|
|
120
|
-
* @param el target element
|
|
121
|
-
* @param deviceId id of the audio output device
|
|
122
|
-
* @returns a promise of whether the operation had success
|
|
123
|
-
*
|
|
124
|
-
* @example
|
|
125
|
-
* ```typescript
|
|
126
|
-
* const el = document.querySelector('video')
|
|
127
|
-
* const outDevices = await SignalWire.WebRTC.getSpeakerDevicesWithPermissions()
|
|
128
|
-
* await SignalWire.WebRTC.setMediaElementSinkId(el, outDevices[0].deviceId)
|
|
129
|
-
* // true
|
|
130
|
-
```
|
|
131
|
-
*/
|
|
132
|
-
export declare const setMediaElementSinkId: (el: HTMLMediaElement | null, deviceId: string) => Promise<undefined>;
|
|
133
|
-
export declare const sdpToJsonHack: (sdp: any) => any;
|
|
134
|
-
export declare const stopStream: (stream?: MediaStream | undefined) => void;
|
|
135
|
-
export declare const stopTrack: (track: MediaStreamTrack) => void;
|
|
136
|
-
//# sourceMappingURL=webrtcHelpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webrtcHelpers.d.ts","sourceRoot":"","sources":["../../../../../webrtc/src/utils/webrtcHelpers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,WAAY,gBAAgB,sBAEzD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAEhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAEhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,eAEnC,CAAA;AAED,eAAO,MAAM,kBAAkB,oBAM9B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,YAAY,iBACV,sBAAsB,yBAoEpC,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,4EAE3B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,gBAAgB,kCAE5B,CAAA;AAED,eAAO,MAAM,sBAAsB,4EAUlC,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,sCAEnC,CAAA;AAED,eAAO,MAAM,aAAa,2DACe,CAAA;AAEzC;;GAEG;AACH,eAAO,MAAM,mBAAmB,eAE/B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,qBAAqB,OAC5B,gBAAgB,GAAG,IAAI,YACjB,MAAM,KACf,QAAQ,SAAS,CAyBnB,CAAA;AAED,eAAO,MAAM,aAAa,QAAS,GAAG,QAAQ,CAAA;AAE9C,eAAO,MAAM,UAAU,4CAItB,CAAA;AAED,eAAO,MAAM,SAAS,UAAW,gBAAgB,SAKhD,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const RTCPeerConnection: (config: RTCConfiguration) => any;
|
|
2
|
-
export declare const getUserMedia: (constraints: MediaStreamConstraints) => any;
|
|
3
|
-
export declare const getDisplayMedia: (constraints: MediaStreamConstraints) => any;
|
|
4
|
-
export declare const supportsGetUserMedia: () => boolean;
|
|
5
|
-
export declare const supportsGetDisplayMedia: () => boolean;
|
|
6
|
-
export declare const enumerateDevices: () => any;
|
|
7
|
-
export declare const enumerateDevicesByKind: (filterByKind: string) => Promise<MediaDeviceInfo[]>;
|
|
8
|
-
export declare const streamIsValid: (stream: RNMediaStream) => any;
|
|
9
|
-
export declare const getSupportedConstraints: () => {};
|
|
10
|
-
export declare const setMediaElementSinkId: (_htmlElementId: string, _deviceId: string) => Promise<boolean>;
|
|
11
|
-
export declare const sdpToJsonHack: (sdp: any) => any;
|
|
12
|
-
export declare const stopStream: (stream: RNMediaStream) => void;
|
|
13
|
-
export declare const stopTrack: (track: MediaStreamTrack) => void;
|
|
14
|
-
//# sourceMappingURL=webrtcHelpers.native.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webrtcHelpers.native.d.ts","sourceRoot":"","sources":["../../../../../webrtc/src/utils/webrtcHelpers.native.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,iBAAiB,WAAY,gBAAgB,QAGzD,CAAA;AAED,eAAO,MAAM,YAAY,gBAAiB,sBAAsB,QAE/D,CAAA;AAED,eAAO,MAAM,eAAe,gBAAiB,sBAAsB,QAElE,CAAA;AAED,eAAO,MAAM,oBAAoB,eAEhC,CAAA;AAED,eAAO,MAAM,uBAAuB,eAEnC,CAAA;AAED,eAAO,MAAM,gBAAgB,WAA0C,CAAA;AAEvE,eAAO,MAAM,sBAAsB,iBAAwB,MAAM,+BAQhE,CAAA;AAED,eAAO,MAAM,aAAa,gCACiB,CAAA;AAE3C,eAAO,MAAM,uBAAuB,UAAa,CAAA;AAEjD,eAAO,MAAM,qBAAqB,mBAChB,MAAM,aACX,MAAM,KAChB,QAAQ,OAAO,CAA2B,CAAA;AAE7C,eAAO,MAAM,aAAa,QAAS,GAAG,QAGrC,CAAA;AAED,eAAO,MAAM,UAAU,iCAKtB,CAAA;AAkBD,eAAO,MAAM,SAAS,UAAW,gBAAgB,SAQhD,CAAA"}
|