@webex/media-helpers 3.0.0-next.2 → 3.0.0-next.4
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/LICENSE +1 -1
- package/README.md +106 -106
- package/babel.config.json +12 -12
- package/dist/constants.d.ts +13 -13
- package/dist/constants.js +59 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +124 -0
- package/dist/index.js.map +1 -0
- package/dist/webrtc-core.d.ts +48 -48
- package/dist/webrtc-core.js +213 -0
- package/dist/webrtc-core.js.map +1 -0
- package/package.json +9 -9
- package/src/constants.ts +29 -29
- package/src/index.ts +25 -25
- package/src/webrtc-core.ts +136 -136
- package/test/unit/spec/webrtc-core.js +145 -145
- package/tsconfig.json +5 -5
package/LICENSE
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
All contents are licensed under the Cisco EULA
|
|
1
|
+
All contents are licensed under the Cisco EULA
|
|
2
2
|
(https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)
|
package/README.md
CHANGED
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
# @webex/media-helpers
|
|
2
|
-
|
|
3
|
-
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
-
|
|
5
|
-
> Media helpers
|
|
6
|
-
|
|
7
|
-
This is an internal Cisco Webex plugin. As such, it does not strictly adhere to semantic versioning. Use at your own risk. If you're not working on one of our first party clients, please look at our [developer api](https://developer.webex.com/) and stick to our public plugins.
|
|
8
|
-
|
|
9
|
-
- [@webex/media-helpers](#webexmedia-helpers)
|
|
10
|
-
- [Install](#install)
|
|
11
|
-
- [Usage](#usage)
|
|
12
|
-
- [Maintainers](#maintainers)
|
|
13
|
-
- [Contribute](#contribute)
|
|
14
|
-
- [License](#license)
|
|
15
|
-
|
|
16
|
-
## Install
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm install --save @webex/media-helpers
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Usage
|
|
23
|
-
|
|
24
|
-
### Effects
|
|
25
|
-
There are two effects included in this package:
|
|
26
|
-
|
|
27
|
-
Virtual background (e.g., blur, image replacement, video replacement)
|
|
28
|
-
Noise reduction (e.g., background noise removal)
|
|
29
|
-
|
|
30
|
-
#### Virtual background
|
|
31
|
-
The virtual background effect provides a virtual background for video calling. The virtual background may be an image, an mp4 video, or the user's background with blur applied.
|
|
32
|
-
|
|
33
|
-
**Applying the effect**
|
|
34
|
-
1. Create a new camera track instance by using LocalCameraTrack() method.
|
|
35
|
-
2. Create a VirtualBackgroundEffect instance by passing appropriate constraints.
|
|
36
|
-
3. Use addEffect() method on cameraTrack to apply effect on it.
|
|
37
|
-
4. Enable the effect after adding it to cameraTrack using enable() method available on effect. Effect will be enabled on cameraTrack.
|
|
38
|
-
|
|
39
|
-
```javascript
|
|
40
|
-
import {LocalCameraTrack, VirtualBackgroundEffect} from '@webex/media-helpers';
|
|
41
|
-
|
|
42
|
-
// Create a new video stream by a getting user's video media.
|
|
43
|
-
const stream = await navigator.mediaDevices.getUserMedia({ video: { width, height } });
|
|
44
|
-
|
|
45
|
-
const videoTrackFromLocalStream = stream.getVideoTracks()[0];
|
|
46
|
-
|
|
47
|
-
const cameraTrack = new LocalCameraTrack(new MediaStream([videoTrackFromLocalStream]));
|
|
48
|
-
|
|
49
|
-
// Create the effect.
|
|
50
|
-
const effect = new VirtualBackgroundEffect({
|
|
51
|
-
authToken: '<encoded-string>',
|
|
52
|
-
mode: `BLUR`,
|
|
53
|
-
blurStrength: `STRONG`,
|
|
54
|
-
quality: `LOW`,
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// add the effect on the input camera track.
|
|
58
|
-
await cameraTrack.addEffect("background-blur", effect);
|
|
59
|
-
|
|
60
|
-
//enable the effect once it is added to the track
|
|
61
|
-
await effect.enable()
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
#### Noise reduction
|
|
65
|
-
The noise reduction effect removes background noise from an audio stream to provide clear audio for calling.
|
|
66
|
-
|
|
67
|
-
**Applying the effect**
|
|
68
|
-
1. Create a new microphone track instance by using LocalMicrophoneTrack() method.
|
|
69
|
-
2. Create a NoiseReductionEffect instance by passing appropriate constraints.
|
|
70
|
-
3. Use addEffect() method on microphoneTrack to apply effect on it.
|
|
71
|
-
4. Enable the effect after adding it to microphoneTrack using enable() method available on effect. Effect will be enabled on microphoneTrack.
|
|
72
|
-
|
|
73
|
-
```javascript
|
|
74
|
-
import {LocalMicrophoneTrack, NoiseReductionEffect} from '@webex/media-helpers';
|
|
75
|
-
|
|
76
|
-
// Create a new audio stream by getting a user's audio media.
|
|
77
|
-
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
78
|
-
|
|
79
|
-
const audioTrackFromLocalStream = stream.getAudioTracks()[0];
|
|
80
|
-
|
|
81
|
-
const microphoneTrack = new LocalMicrophoneTrack(new MediaStream([audioTrackFromLocalStream]));
|
|
82
|
-
|
|
83
|
-
// Create the effect.
|
|
84
|
-
const effect = new NoiseReductionEffect({
|
|
85
|
-
authToken: '<encoded-string>',
|
|
86
|
-
mode: 'WORKLET', // or 'LEGACY'
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
// add the effect on microphone track.
|
|
90
|
-
await microphoneTrack.addEffect("background-noise-removal", effect);
|
|
91
|
-
|
|
92
|
-
//enable the effect once it is added to the track
|
|
93
|
-
await effect.enable()
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Maintainers
|
|
97
|
-
|
|
98
|
-
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
99
|
-
|
|
100
|
-
## Contribute
|
|
101
|
-
|
|
102
|
-
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
103
|
-
|
|
104
|
-
## License
|
|
105
|
-
|
|
106
|
-
© 2016-2022 Cisco and/or its affiliates. All Rights Reserved.
|
|
1
|
+
# @webex/media-helpers
|
|
2
|
+
|
|
3
|
+
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
+
|
|
5
|
+
> Media helpers
|
|
6
|
+
|
|
7
|
+
This is an internal Cisco Webex plugin. As such, it does not strictly adhere to semantic versioning. Use at your own risk. If you're not working on one of our first party clients, please look at our [developer api](https://developer.webex.com/) and stick to our public plugins.
|
|
8
|
+
|
|
9
|
+
- [@webex/media-helpers](#webexmedia-helpers)
|
|
10
|
+
- [Install](#install)
|
|
11
|
+
- [Usage](#usage)
|
|
12
|
+
- [Maintainers](#maintainers)
|
|
13
|
+
- [Contribute](#contribute)
|
|
14
|
+
- [License](#license)
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install --save @webex/media-helpers
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### Effects
|
|
25
|
+
There are two effects included in this package:
|
|
26
|
+
|
|
27
|
+
Virtual background (e.g., blur, image replacement, video replacement)
|
|
28
|
+
Noise reduction (e.g., background noise removal)
|
|
29
|
+
|
|
30
|
+
#### Virtual background
|
|
31
|
+
The virtual background effect provides a virtual background for video calling. The virtual background may be an image, an mp4 video, or the user's background with blur applied.
|
|
32
|
+
|
|
33
|
+
**Applying the effect**
|
|
34
|
+
1. Create a new camera track instance by using LocalCameraTrack() method.
|
|
35
|
+
2. Create a VirtualBackgroundEffect instance by passing appropriate constraints.
|
|
36
|
+
3. Use addEffect() method on cameraTrack to apply effect on it.
|
|
37
|
+
4. Enable the effect after adding it to cameraTrack using enable() method available on effect. Effect will be enabled on cameraTrack.
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
import {LocalCameraTrack, VirtualBackgroundEffect} from '@webex/media-helpers';
|
|
41
|
+
|
|
42
|
+
// Create a new video stream by a getting user's video media.
|
|
43
|
+
const stream = await navigator.mediaDevices.getUserMedia({ video: { width, height } });
|
|
44
|
+
|
|
45
|
+
const videoTrackFromLocalStream = stream.getVideoTracks()[0];
|
|
46
|
+
|
|
47
|
+
const cameraTrack = new LocalCameraTrack(new MediaStream([videoTrackFromLocalStream]));
|
|
48
|
+
|
|
49
|
+
// Create the effect.
|
|
50
|
+
const effect = new VirtualBackgroundEffect({
|
|
51
|
+
authToken: '<encoded-string>',
|
|
52
|
+
mode: `BLUR`,
|
|
53
|
+
blurStrength: `STRONG`,
|
|
54
|
+
quality: `LOW`,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// add the effect on the input camera track.
|
|
58
|
+
await cameraTrack.addEffect("background-blur", effect);
|
|
59
|
+
|
|
60
|
+
//enable the effect once it is added to the track
|
|
61
|
+
await effect.enable()
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Noise reduction
|
|
65
|
+
The noise reduction effect removes background noise from an audio stream to provide clear audio for calling.
|
|
66
|
+
|
|
67
|
+
**Applying the effect**
|
|
68
|
+
1. Create a new microphone track instance by using LocalMicrophoneTrack() method.
|
|
69
|
+
2. Create a NoiseReductionEffect instance by passing appropriate constraints.
|
|
70
|
+
3. Use addEffect() method on microphoneTrack to apply effect on it.
|
|
71
|
+
4. Enable the effect after adding it to microphoneTrack using enable() method available on effect. Effect will be enabled on microphoneTrack.
|
|
72
|
+
|
|
73
|
+
```javascript
|
|
74
|
+
import {LocalMicrophoneTrack, NoiseReductionEffect} from '@webex/media-helpers';
|
|
75
|
+
|
|
76
|
+
// Create a new audio stream by getting a user's audio media.
|
|
77
|
+
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
78
|
+
|
|
79
|
+
const audioTrackFromLocalStream = stream.getAudioTracks()[0];
|
|
80
|
+
|
|
81
|
+
const microphoneTrack = new LocalMicrophoneTrack(new MediaStream([audioTrackFromLocalStream]));
|
|
82
|
+
|
|
83
|
+
// Create the effect.
|
|
84
|
+
const effect = new NoiseReductionEffect({
|
|
85
|
+
authToken: '<encoded-string>',
|
|
86
|
+
mode: 'WORKLET', // or 'LEGACY'
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// add the effect on microphone track.
|
|
90
|
+
await microphoneTrack.addEffect("background-noise-removal", effect);
|
|
91
|
+
|
|
92
|
+
//enable the effect once it is added to the track
|
|
93
|
+
await effect.enable()
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Maintainers
|
|
97
|
+
|
|
98
|
+
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
99
|
+
|
|
100
|
+
## Contribute
|
|
101
|
+
|
|
102
|
+
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
© 2016-2022 Cisco and/or its affiliates. All Rights Reserved.
|
package/babel.config.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": [
|
|
3
|
-
[
|
|
4
|
-
"@babel/preset-env",
|
|
5
|
-
{
|
|
6
|
-
"targets": {
|
|
7
|
-
"node": "current"
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
|
-
"@babel/preset-typescript"
|
|
12
|
-
],
|
|
1
|
+
{
|
|
2
|
+
"presets": [
|
|
3
|
+
[
|
|
4
|
+
"@babel/preset-env",
|
|
5
|
+
{
|
|
6
|
+
"targets": {
|
|
7
|
+
"node": "current"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"@babel/preset-typescript"
|
|
12
|
+
],
|
|
13
13
|
}
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { VideoDeviceConstraints } from '@webex/internal-media-core';
|
|
2
|
-
export declare enum FacingMode {
|
|
3
|
-
user = "user",
|
|
4
|
-
environment = "environment"
|
|
5
|
-
}
|
|
6
|
-
export declare enum DisplaySurface {
|
|
7
|
-
browser = "browser",
|
|
8
|
-
monitor = "monitor",
|
|
9
|
-
window = "window"
|
|
10
|
-
}
|
|
11
|
-
export declare const PresetCameraConstraints: {
|
|
12
|
-
[key: string]: VideoDeviceConstraints;
|
|
13
|
-
};
|
|
1
|
+
import { VideoDeviceConstraints } from '@webex/internal-media-core';
|
|
2
|
+
export declare enum FacingMode {
|
|
3
|
+
user = "user",
|
|
4
|
+
environment = "environment"
|
|
5
|
+
}
|
|
6
|
+
export declare enum DisplaySurface {
|
|
7
|
+
browser = "browser",
|
|
8
|
+
monitor = "monitor",
|
|
9
|
+
window = "window"
|
|
10
|
+
}
|
|
11
|
+
export declare const PresetCameraConstraints: {
|
|
12
|
+
[key: string]: VideoDeviceConstraints;
|
|
13
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.PresetCameraConstraints = exports.FacingMode = exports.DisplaySurface = void 0;
|
|
8
|
+
var FacingMode; // can be used later on when we add constraints in create display track
|
|
9
|
+
exports.FacingMode = FacingMode;
|
|
10
|
+
(function (FacingMode) {
|
|
11
|
+
FacingMode["user"] = "user";
|
|
12
|
+
FacingMode["environment"] = "environment";
|
|
13
|
+
})(FacingMode || (exports.FacingMode = FacingMode = {}));
|
|
14
|
+
var DisplaySurface;
|
|
15
|
+
exports.DisplaySurface = DisplaySurface;
|
|
16
|
+
(function (DisplaySurface) {
|
|
17
|
+
DisplaySurface["browser"] = "browser";
|
|
18
|
+
DisplaySurface["monitor"] = "monitor";
|
|
19
|
+
DisplaySurface["window"] = "window";
|
|
20
|
+
})(DisplaySurface || (exports.DisplaySurface = DisplaySurface = {}));
|
|
21
|
+
var PresetCameraConstraints = {
|
|
22
|
+
'1080p': {
|
|
23
|
+
frameRate: 30,
|
|
24
|
+
width: 1920,
|
|
25
|
+
height: 1080
|
|
26
|
+
},
|
|
27
|
+
'720p': {
|
|
28
|
+
frameRate: 30,
|
|
29
|
+
width: 1280,
|
|
30
|
+
height: 720
|
|
31
|
+
},
|
|
32
|
+
'480p': {
|
|
33
|
+
frameRate: 30,
|
|
34
|
+
width: 640,
|
|
35
|
+
height: 480
|
|
36
|
+
},
|
|
37
|
+
'360p': {
|
|
38
|
+
frameRate: 30,
|
|
39
|
+
width: 640,
|
|
40
|
+
height: 360
|
|
41
|
+
},
|
|
42
|
+
'240p': {
|
|
43
|
+
frameRate: 30,
|
|
44
|
+
width: 320,
|
|
45
|
+
height: 240
|
|
46
|
+
},
|
|
47
|
+
'180p': {
|
|
48
|
+
frameRate: 30,
|
|
49
|
+
width: 320,
|
|
50
|
+
height: 180
|
|
51
|
+
},
|
|
52
|
+
'120p': {
|
|
53
|
+
frameRate: 30,
|
|
54
|
+
width: 160,
|
|
55
|
+
height: 120
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.PresetCameraConstraints = PresetCameraConstraints;
|
|
59
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FacingMode","exports","DisplaySurface","PresetCameraConstraints","frameRate","width","height"],"sources":["constants.ts"],"sourcesContent":["import {VideoDeviceConstraints} from '@webex/internal-media-core';\r\n\r\nexport enum FacingMode {\r\n user = 'user',\r\n environment = 'environment',\r\n}\r\n\r\n// can be used later on when we add constraints in create display track\r\nexport enum DisplaySurface {\r\n browser = 'browser',\r\n monitor = 'monitor',\r\n window = 'window',\r\n}\r\n\r\nexport const PresetCameraConstraints: {[key: string]: VideoDeviceConstraints} = {\r\n '1080p': {frameRate: 30, width: 1920, height: 1080},\r\n\r\n '720p': {frameRate: 30, width: 1280, height: 720},\r\n\r\n '480p': {frameRate: 30, width: 640, height: 480},\r\n\r\n '360p': {frameRate: 30, width: 640, height: 360},\r\n\r\n '240p': {frameRate: 30, width: 320, height: 240},\r\n\r\n '180p': {frameRate: 30, width: 320, height: 180},\r\n\r\n '120p': {frameRate: 30, width: 160, height: 120},\r\n};\r\n"],"mappings":";;;;;;;IAEYA,UAAU,EAKtB;AAAAC,OAAA,CAAAD,UAAA,GAAAA,UAAA;AAAA,WALYA,UAAU;EAAVA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,KAAAC,OAAA,CAAAD,UAAA,GAAVA,UAAU;AAAA,IAMVE,cAAc;AAAAD,OAAA,CAAAC,cAAA,GAAAA,cAAA;AAAA,WAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;AAAA,GAAdA,cAAc,KAAAD,OAAA,CAAAC,cAAA,GAAdA,cAAc;AAMnB,IAAMC,uBAAgE,GAAG;EAC9E,OAAO,EAAE;IAACC,SAAS,EAAE,EAAE;IAAEC,KAAK,EAAE,IAAI;IAAEC,MAAM,EAAE;EAAI,CAAC;EAEnD,MAAM,EAAE;IAACF,SAAS,EAAE,EAAE;IAAEC,KAAK,EAAE,IAAI;IAAEC,MAAM,EAAE;EAAG,CAAC;EAEjD,MAAM,EAAE;IAACF,SAAS,EAAE,EAAE;IAAEC,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAG,CAAC;EAEhD,MAAM,EAAE;IAACF,SAAS,EAAE,EAAE;IAAEC,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAG,CAAC;EAEhD,MAAM,EAAE;IAACF,SAAS,EAAE,EAAE;IAAEC,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAG,CAAC;EAEhD,MAAM,EAAE;IAACF,SAAS,EAAE,EAAE;IAAEC,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAG,CAAC;EAEhD,MAAM,EAAE;IAACF,SAAS,EAAE,EAAE;IAAEC,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAG;AACjD,CAAC;AAACL,OAAA,CAAAE,uBAAA,GAAAA,uBAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { getDevices, LocalStream, LocalDisplayStream, LocalSystemAudioStream, LocalStreamEventNames, StreamEventNames, type ServerMuteReason, LocalMicrophoneStreamEventNames, LocalCameraStreamEventNames, LocalMicrophoneStream, LocalCameraStream, createMicrophoneStream, createCameraStream, createDisplayStream, createDisplayStreamWithAudio, } from './webrtc-core';
|
|
2
|
-
export { NoiseReductionEffect, VirtualBackgroundEffect } from '@webex/web-media-effects';
|
|
3
|
-
export type { NoiseReductionEffectOptions, VirtualBackgroundEffectOptions, } from '@webex/web-media-effects';
|
|
4
|
-
export { FacingMode, DisplaySurface, PresetCameraConstraints } from './constants';
|
|
1
|
+
export { getDevices, LocalStream, LocalDisplayStream, LocalSystemAudioStream, LocalStreamEventNames, StreamEventNames, type ServerMuteReason, LocalMicrophoneStreamEventNames, LocalCameraStreamEventNames, LocalMicrophoneStream, LocalCameraStream, createMicrophoneStream, createCameraStream, createDisplayStream, createDisplayStreamWithAudio, } from './webrtc-core';
|
|
2
|
+
export { NoiseReductionEffect, VirtualBackgroundEffect } from '@webex/web-media-effects';
|
|
3
|
+
export type { NoiseReductionEffectOptions, VirtualBackgroundEffectOptions, } from '@webex/web-media-effects';
|
|
4
|
+
export { FacingMode, DisplaySurface, PresetCameraConstraints } from './constants';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
_Object$defineProperty(exports, "DisplaySurface", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _constants.DisplaySurface;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
_Object$defineProperty(exports, "FacingMode", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _constants.FacingMode;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
_Object$defineProperty(exports, "LocalCameraStream", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function get() {
|
|
22
|
+
return _webrtcCore.LocalCameraStream;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
_Object$defineProperty(exports, "LocalCameraStreamEventNames", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _webrtcCore.LocalCameraStreamEventNames;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
_Object$defineProperty(exports, "LocalDisplayStream", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function get() {
|
|
34
|
+
return _webrtcCore.LocalDisplayStream;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
_Object$defineProperty(exports, "LocalMicrophoneStream", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function get() {
|
|
40
|
+
return _webrtcCore.LocalMicrophoneStream;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
_Object$defineProperty(exports, "LocalMicrophoneStreamEventNames", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function get() {
|
|
46
|
+
return _webrtcCore.LocalMicrophoneStreamEventNames;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
_Object$defineProperty(exports, "LocalStream", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function get() {
|
|
52
|
+
return _webrtcCore.LocalStream;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
_Object$defineProperty(exports, "LocalStreamEventNames", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function get() {
|
|
58
|
+
return _webrtcCore.LocalStreamEventNames;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
_Object$defineProperty(exports, "LocalSystemAudioStream", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function get() {
|
|
64
|
+
return _webrtcCore.LocalSystemAudioStream;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
_Object$defineProperty(exports, "NoiseReductionEffect", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function get() {
|
|
70
|
+
return _webMediaEffects.NoiseReductionEffect;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
_Object$defineProperty(exports, "PresetCameraConstraints", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function get() {
|
|
76
|
+
return _constants.PresetCameraConstraints;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
_Object$defineProperty(exports, "StreamEventNames", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function get() {
|
|
82
|
+
return _webrtcCore.StreamEventNames;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
_Object$defineProperty(exports, "VirtualBackgroundEffect", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function get() {
|
|
88
|
+
return _webMediaEffects.VirtualBackgroundEffect;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
_Object$defineProperty(exports, "createCameraStream", {
|
|
92
|
+
enumerable: true,
|
|
93
|
+
get: function get() {
|
|
94
|
+
return _webrtcCore.createCameraStream;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
_Object$defineProperty(exports, "createDisplayStream", {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function get() {
|
|
100
|
+
return _webrtcCore.createDisplayStream;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
_Object$defineProperty(exports, "createDisplayStreamWithAudio", {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
get: function get() {
|
|
106
|
+
return _webrtcCore.createDisplayStreamWithAudio;
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
_Object$defineProperty(exports, "createMicrophoneStream", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function get() {
|
|
112
|
+
return _webrtcCore.createMicrophoneStream;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
_Object$defineProperty(exports, "getDevices", {
|
|
116
|
+
enumerable: true,
|
|
117
|
+
get: function get() {
|
|
118
|
+
return _webrtcCore.getDevices;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
var _webrtcCore = require("./webrtc-core");
|
|
122
|
+
var _webMediaEffects = require("@webex/web-media-effects");
|
|
123
|
+
var _constants = require("./constants");
|
|
124
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_webrtcCore","require","_webMediaEffects","_constants"],"sources":["index.ts"],"sourcesContent":["export {\r\n getDevices,\r\n LocalStream,\r\n LocalDisplayStream,\r\n LocalSystemAudioStream,\r\n LocalStreamEventNames,\r\n StreamEventNames,\r\n type ServerMuteReason,\r\n LocalMicrophoneStreamEventNames,\r\n LocalCameraStreamEventNames,\r\n LocalMicrophoneStream,\r\n LocalCameraStream,\r\n createMicrophoneStream,\r\n createCameraStream,\r\n createDisplayStream,\r\n createDisplayStreamWithAudio,\r\n} from './webrtc-core';\r\n\r\nexport {NoiseReductionEffect, VirtualBackgroundEffect} from '@webex/web-media-effects';\r\nexport type {\r\n NoiseReductionEffectOptions,\r\n VirtualBackgroundEffectOptions,\r\n} from '@webex/web-media-effects';\r\n\r\nexport {FacingMode, DisplaySurface, PresetCameraConstraints} from './constants';\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAkBA,IAAAC,gBAAA,GAAAD,OAAA;AAMA,IAAAE,UAAA,GAAAF,OAAA"}
|
package/dist/webrtc-core.d.ts
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { AudioDeviceConstraints, LocalDisplayStream, LocalSystemAudioStream, LocalMicrophoneStream as WcmeLocalMicrophoneStream, LocalCameraStream as WcmeLocalCameraStream, VideoDeviceConstraints } from '@webex/internal-media-core';
|
|
2
|
-
import { TypedEvent } from '@webex/ts-events';
|
|
3
|
-
export { getDevices, LocalStream, LocalDisplayStream, LocalSystemAudioStream, LocalStreamEventNames, StreamEventNames, RemoteStream, } from '@webex/internal-media-core';
|
|
4
|
-
export type ServerMuteReason = 'remotelyMuted' | 'clientRequestFailed' | 'localUnmuteRequired';
|
|
5
|
-
export declare enum LocalMicrophoneStreamEventNames {
|
|
6
|
-
ServerMuted = "muted:byServer"
|
|
7
|
-
}
|
|
8
|
-
export declare enum LocalCameraStreamEventNames {
|
|
9
|
-
ServerMuted = "muted:byServer"
|
|
10
|
-
}
|
|
11
|
-
export declare class LocalMicrophoneStream extends WcmeLocalMicrophoneStream {
|
|
12
|
-
private unmuteAllowed;
|
|
13
|
-
[LocalMicrophoneStreamEventNames.ServerMuted]: TypedEvent<(muted: boolean, reason: ServerMuteReason) => void>;
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
setUnmuteAllowed(allowed: any): void;
|
|
18
|
-
/**
|
|
19
|
-
* @returns true if user is allowed to unmute the Stream, false otherwise
|
|
20
|
-
*/
|
|
21
|
-
isUnmuteAllowed(): boolean;
|
|
22
|
-
setMuted(muted: boolean): void;
|
|
23
|
-
/**
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
setServerMuted(muted: boolean, reason: ServerMuteReason): void;
|
|
27
|
-
}
|
|
28
|
-
export declare class LocalCameraStream extends WcmeLocalCameraStream {
|
|
29
|
-
private unmuteAllowed;
|
|
30
|
-
[LocalCameraStreamEventNames.ServerMuted]: TypedEvent<(muted: boolean, reason: ServerMuteReason) => void>;
|
|
31
|
-
/**
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
setUnmuteAllowed(allowed: any): void;
|
|
35
|
-
/**
|
|
36
|
-
* @returns true if user is allowed to unmute the Stream, false otherwise
|
|
37
|
-
*/
|
|
38
|
-
isUnmuteAllowed(): boolean;
|
|
39
|
-
setMuted(muted: boolean): void;
|
|
40
|
-
/**
|
|
41
|
-
* @internal
|
|
42
|
-
*/
|
|
43
|
-
setServerMuted(muted: boolean, reason: ServerMuteReason): void;
|
|
44
|
-
}
|
|
45
|
-
export declare const createMicrophoneStream: (constraints?: AudioDeviceConstraints) => Promise<LocalMicrophoneStream>;
|
|
46
|
-
export declare const createCameraStream: (constraints?: VideoDeviceConstraints) => Promise<LocalCameraStream>;
|
|
47
|
-
export declare const createDisplayStream: () => Promise<LocalDisplayStream>;
|
|
48
|
-
export declare const createDisplayStreamWithAudio: () => Promise<[LocalDisplayStream, LocalSystemAudioStream]>;
|
|
1
|
+
import { AudioDeviceConstraints, LocalDisplayStream, LocalSystemAudioStream, LocalMicrophoneStream as WcmeLocalMicrophoneStream, LocalCameraStream as WcmeLocalCameraStream, VideoDeviceConstraints } from '@webex/internal-media-core';
|
|
2
|
+
import { TypedEvent } from '@webex/ts-events';
|
|
3
|
+
export { getDevices, LocalStream, LocalDisplayStream, LocalSystemAudioStream, LocalStreamEventNames, StreamEventNames, RemoteStream, } from '@webex/internal-media-core';
|
|
4
|
+
export type ServerMuteReason = 'remotelyMuted' | 'clientRequestFailed' | 'localUnmuteRequired';
|
|
5
|
+
export declare enum LocalMicrophoneStreamEventNames {
|
|
6
|
+
ServerMuted = "muted:byServer"
|
|
7
|
+
}
|
|
8
|
+
export declare enum LocalCameraStreamEventNames {
|
|
9
|
+
ServerMuted = "muted:byServer"
|
|
10
|
+
}
|
|
11
|
+
export declare class LocalMicrophoneStream extends WcmeLocalMicrophoneStream {
|
|
12
|
+
private unmuteAllowed;
|
|
13
|
+
[LocalMicrophoneStreamEventNames.ServerMuted]: TypedEvent<(muted: boolean, reason: ServerMuteReason) => void>;
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
setUnmuteAllowed(allowed: any): void;
|
|
18
|
+
/**
|
|
19
|
+
* @returns true if user is allowed to unmute the Stream, false otherwise
|
|
20
|
+
*/
|
|
21
|
+
isUnmuteAllowed(): boolean;
|
|
22
|
+
setMuted(muted: boolean): void;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
setServerMuted(muted: boolean, reason: ServerMuteReason): void;
|
|
27
|
+
}
|
|
28
|
+
export declare class LocalCameraStream extends WcmeLocalCameraStream {
|
|
29
|
+
private unmuteAllowed;
|
|
30
|
+
[LocalCameraStreamEventNames.ServerMuted]: TypedEvent<(muted: boolean, reason: ServerMuteReason) => void>;
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
setUnmuteAllowed(allowed: any): void;
|
|
35
|
+
/**
|
|
36
|
+
* @returns true if user is allowed to unmute the Stream, false otherwise
|
|
37
|
+
*/
|
|
38
|
+
isUnmuteAllowed(): boolean;
|
|
39
|
+
setMuted(muted: boolean): void;
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
setServerMuted(muted: boolean, reason: ServerMuteReason): void;
|
|
44
|
+
}
|
|
45
|
+
export declare const createMicrophoneStream: (constraints?: AudioDeviceConstraints) => Promise<LocalMicrophoneStream>;
|
|
46
|
+
export declare const createCameraStream: (constraints?: VideoDeviceConstraints) => Promise<LocalCameraStream>;
|
|
47
|
+
export declare const createDisplayStream: () => Promise<LocalDisplayStream>;
|
|
48
|
+
export declare const createDisplayStreamWithAudio: () => Promise<[LocalDisplayStream, LocalSystemAudioStream]>;
|