Преглед на файлове

feat: Adds a method that finds the SSRC of a JitsiTrack (#1338)

Adds a JitsiConference.getSsrcByTrack() method that finds the SSRC of a JitsiTrack by its SSRC. This method is currently used to get (and display) the first audio/video SSRC in the GSM popover in Jitsi Meet.

Co-authored-by: George Politis <gp@jitsi.org>
dev1
Hristo Terezov преди 5 години
родител
ревизия
679497938f
No account linked to committer's email address
променени са 4 файла, в които са добавени 39 реда и са изтрити 1 реда
  1. 10
    1
      JitsiConference.js
  2. 27
    0
      package-lock.json
  3. 1
    0
      package.json
  4. 1
    0
      webpack-shared-config.js

+ 10
- 1
JitsiConference.js Целия файл

2422
     return this.statistics.isCallstatsEnabled();
2422
     return this.statistics.isCallstatsEnabled();
2423
 };
2423
 };
2424
 
2424
 
2425
+/**
2426
+ * Finds the SSRC of a given track
2427
+ *
2428
+ * @param track
2429
+ * @returns {number|undefined} the SSRC of the specificed track, otherwise undefined.
2430
+ */
2431
+JitsiConference.prototype.getSsrcByTrack = function(track) {
2432
+    return track.isLocal() ? this.getActivePeerConnection()?.getLocalSSRC(track) : track.getSSRC();
2433
+};
2425
 
2434
 
2426
 /**
2435
 /**
2427
  * Handles track attached to container (Calls associateStreamWithVideoTag method
2436
  * Handles track attached to container (Calls associateStreamWithVideoTag method
2440
             : this.jvbJingleSession && this.jvbJingleSession.peerconnection;
2449
             : this.jvbJingleSession && this.jvbJingleSession.peerconnection;
2441
 
2450
 
2442
     if (isLocal) {
2451
     if (isLocal) {
2443
-        // Local tracks have SSRC stored on per peer connection basis
2452
+        // Local tracks have SSRC stored on per peer connection basis.
2444
         if (peerConnection) {
2453
         if (peerConnection) {
2445
             ssrc = peerConnection.getLocalSSRC(track);
2454
             ssrc = peerConnection.getLocalSSRC(track);
2446
         }
2455
         }

+ 27
- 0
package-lock.json Целия файл

629
         "@babel/plugin-syntax-optional-catch-binding": "^7.0.0"
629
         "@babel/plugin-syntax-optional-catch-binding": "^7.0.0"
630
       }
630
       }
631
     },
631
     },
632
+    "@babel/plugin-proposal-optional-chaining": {
633
+      "version": "7.2.0",
634
+      "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.2.0.tgz",
635
+      "integrity": "sha512-ea3Q6edZC/55wEBVZAEz42v528VulyO0eir+7uky/sT4XRcdkWJcFi1aPtitTlwUzGnECWJNExWww1SStt+yWw==",
636
+      "dev": true,
637
+      "requires": {
638
+        "@babel/helper-plugin-utils": "^7.0.0",
639
+        "@babel/plugin-syntax-optional-chaining": "^7.2.0"
640
+      }
641
+    },
632
     "@babel/plugin-proposal-unicode-property-regex": {
642
     "@babel/plugin-proposal-unicode-property-regex": {
633
       "version": "7.0.0",
643
       "version": "7.0.0",
634
       "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0.tgz",
644
       "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0.tgz",
746
         "@babel/helper-plugin-utils": "^7.0.0"
756
         "@babel/helper-plugin-utils": "^7.0.0"
747
       }
757
       }
748
     },
758
     },
759
+    "@babel/plugin-syntax-optional-chaining": {
760
+      "version": "7.8.3",
761
+      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz",
762
+      "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==",
763
+      "dev": true,
764
+      "requires": {
765
+        "@babel/helper-plugin-utils": "^7.8.0"
766
+      },
767
+      "dependencies": {
768
+        "@babel/helper-plugin-utils": {
769
+          "version": "7.10.4",
770
+          "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz",
771
+          "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==",
772
+          "dev": true
773
+        }
774
+      }
775
+    },
749
     "@babel/plugin-transform-arrow-functions": {
776
     "@babel/plugin-transform-arrow-functions": {
750
       "version": "7.0.0",
777
       "version": "7.0.0",
751
       "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0.tgz",
778
       "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0.tgz",

+ 1
- 0
package.json Целия файл

37
     "@babel/core": "7.5.5",
37
     "@babel/core": "7.5.5",
38
     "@babel/plugin-proposal-class-properties": "7.1.0",
38
     "@babel/plugin-proposal-class-properties": "7.1.0",
39
     "@babel/plugin-proposal-export-namespace-from": "7.0.0",
39
     "@babel/plugin-proposal-export-namespace-from": "7.0.0",
40
+    "@babel/plugin-proposal-optional-chaining": "7.2.0",
40
     "@babel/plugin-transform-flow-strip-types": "7.0.0",
41
     "@babel/plugin-transform-flow-strip-types": "7.0.0",
41
     "@babel/preset-env": "7.1.0",
42
     "@babel/preset-env": "7.1.0",
42
     "@babel/preset-flow": "7.0.0",
43
     "@babel/preset-flow": "7.0.0",

+ 1
- 0
webpack-shared-config.js Целия файл

58
                 plugins: [
58
                 plugins: [
59
                     '@babel/plugin-transform-flow-strip-types',
59
                     '@babel/plugin-transform-flow-strip-types',
60
                     '@babel/plugin-proposal-class-properties',
60
                     '@babel/plugin-proposal-class-properties',
61
+                    '@babel/plugin-proposal-optional-chaining',
61
                     '@babel/plugin-proposal-export-namespace-from'
62
                     '@babel/plugin-proposal-export-namespace-from'
62
                 ]
63
                 ]
63
             },
64
             },

Loading…
Отказ
Запис