Kaynağa Gözat

feat(SS): Expose SS sourceType

dev1
hristoterezov 8 yıl önce
ebeveyn
işleme
d2ecc6003a

+ 3
- 1
modules/RTC/JitsiLocalTrack.js Dosyayı Görüntüle

@@ -73,7 +73,8 @@ export default class JitsiLocalTrack extends JitsiTrack {
73 73
             resolution,
74 74
             deviceId,
75 75
             facingMode,
76
-            sourceId
76
+            sourceId,
77
+            sourceType
77 78
         } = trackInfo;
78 79
 
79 80
         super(
@@ -97,6 +98,7 @@ export default class JitsiLocalTrack extends JitsiTrack {
97 98
         this.dontFireRemoveEvent = false;
98 99
         this.resolution = resolution;
99 100
         this.sourceId = sourceId;
101
+        this.sourceType = sourceType;
100 102
 
101 103
         // FIXME: currently firefox is ignoring our constraints about
102 104
         // resolutions so we do not store it, to avoid wrong reporting of local

+ 2
- 1
modules/RTC/RTCUtils.js Dosyayı Görüntüle

@@ -629,11 +629,12 @@ function handleLocalStream(streams, resolution) {
629 629
     }
630 630
 
631 631
     if (desktopStream) {
632
-        const { stream, sourceId } = desktopStream;
632
+        const { stream, sourceId, sourceType } = desktopStream;
633 633
 
634 634
         res.push({
635 635
             stream,
636 636
             sourceId,
637
+            sourceType,
637 638
             track: stream.getVideoTracks()[0],
638 639
             mediaType: MediaType.VIDEO,
639 640
             videoType: VideoType.DESKTOP

+ 11
- 4
modules/RTC/ScreenObtainer.js Dosyayı Görüntüle

@@ -120,9 +120,12 @@ const ScreenObtainer = {
120 120
                 if (window.JitsiMeetScreenObtainer
121 121
                     && window.JitsiMeetScreenObtainer.openDesktopPicker) {
122 122
                     window.JitsiMeetScreenObtainer.openDesktopPicker(
123
-                        streamId =>
123
+                        (streamId, streamType) =>
124 124
                             onGetStreamResponse(
125
-                                { streamId },
125
+                                {
126
+                                    streamId,
127
+                                    streamType
128
+                                },
126 129
                                 onSuccess,
127 130
                                 onFailure
128 131
                             ),
@@ -570,13 +573,17 @@ function waitForExtensionAfterInstall(options, waitInterval, retries) {
570 573
  * @param {Function} onSuccess - callback for success.
571 574
  * @param {Function} onFailure - callback for failure.
572 575
  */
573
-function onGetStreamResponse({ streamId, error }, onSuccess, onFailure) {
576
+function onGetStreamResponse(
577
+        { streamId, streamType, error },
578
+        onSuccess,
579
+        onFailure) {
574 580
     if (streamId) {
575 581
         gumFunction(
576 582
             [ 'desktop' ],
577 583
             stream => onSuccess({
578 584
                 stream,
579
-                sourceId: streamId
585
+                sourceId: streamId,
586
+                sourceType: streamType
580 587
             }),
581 588
             onFailure,
582 589
             { desktopStream: streamId });

Loading…
İptal
Kaydet