Преглед изворни кода

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,6 +2422,15 @@ JitsiConference.prototype.isCallstatsEnabled = function() {
2422 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 2436
  * Handles track attached to container (Calls associateStreamWithVideoTag method
@@ -2440,7 +2449,7 @@ JitsiConference.prototype._onTrackAttach = function(track, container) {
2440 2449
             : this.jvbJingleSession && this.jvbJingleSession.peerconnection;
2441 2450
 
2442 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 2453
         if (peerConnection) {
2445 2454
             ssrc = peerConnection.getLocalSSRC(track);
2446 2455
         }

+ 27
- 0
package-lock.json Прегледај датотеку

@@ -629,6 +629,16 @@
629 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 642
     "@babel/plugin-proposal-unicode-property-regex": {
633 643
       "version": "7.0.0",
634 644
       "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0.tgz",
@@ -746,6 +756,23 @@
746 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 776
     "@babel/plugin-transform-arrow-functions": {
750 777
       "version": "7.0.0",
751 778
       "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0.tgz",

+ 1
- 0
package.json Прегледај датотеку

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

+ 1
- 0
webpack-shared-config.js Прегледај датотеку

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

Loading…
Откажи
Сачувај