feat(screenshare): emit source type when starting screenshare (#3959)
* feat(screenshare): emit source type when starting screenshare * squash: update doc
This commit is contained in:
parent
98c7430b6f
commit
08f2edf350
|
@ -1326,7 +1326,14 @@ export default {
|
|||
this.isSharingScreen = newStream && newStream.videoType === 'desktop';
|
||||
|
||||
if (wasSharingScreen !== this.isSharingScreen) {
|
||||
APP.API.notifyScreenSharingStatusChanged(this.isSharingScreen);
|
||||
const details = {};
|
||||
|
||||
if (this.isSharingScreen) {
|
||||
details.sourceType = newStream.sourceType;
|
||||
}
|
||||
|
||||
APP.API.notifyScreenSharingStatusChanged(
|
||||
this.isSharingScreen, details);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -168,7 +168,14 @@ changes. The listener will receive an object with the following structure:
|
|||
* **screenSharingStatusChanged** - receives event notifications about turning on/off the local user screen sharing. The listener will receive object with the following structure:
|
||||
```javascript
|
||||
{
|
||||
"on": on //whether screen sharing is on
|
||||
"on": on, //whether screen sharing is on
|
||||
"details": {
|
||||
|
||||
// From where the screen sharing is capturing, if known. Values which are
|
||||
// passed include "window", "screen", "proxy", "device". The value undefined
|
||||
// will be passed if the source type is unknown or screen share is off.
|
||||
sourceType: sourceType
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -556,12 +556,17 @@ class API {
|
|||
* has been turned on/off.
|
||||
*
|
||||
* @param {boolean} on - True if screen sharing is enabled.
|
||||
* @param {Object} details - Additional information about the screen
|
||||
* sharing.
|
||||
* @param {string} details.sourceType - Type of device or window the screen
|
||||
* share is capturing.
|
||||
* @returns {void}
|
||||
*/
|
||||
notifyScreenSharingStatusChanged(on: boolean) {
|
||||
notifyScreenSharingStatusChanged(on: boolean, details: Object) {
|
||||
this._sendEvent({
|
||||
name: 'screen-sharing-status-changed',
|
||||
on
|
||||
on,
|
||||
details
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue