Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(screenshare): emit source type when starting screenshare (#3959)
virtuacoplenny08f2edf350ef
diff --git a/conference.js b/conference.jsindex 73017dd40f..4eb0f70026 100644--- a/conference.js+++ b/conference.js@@ -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);}},diff --git a/doc/api.md b/doc/api.mdindex 4de9ccda7c..db7c895909 100644--- a/doc/api.md+++ b/doc/api.md@@ -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+}}```diff --git a/modules/API/API.js b/modules/API/API.jsindex 773813d58f..460f806b63 100644--- a/modules/API/API.js+++ b/modules/API/API.js@@ -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});}