Procházet zdrojové kódy

use JitsiParticipant; add some method implementations

dev1
isymchych před 9 roky
rodič
revize
56328fcf58
5 změnil soubory, kde provedl 1496 přidání a 1003 odebrání
  1. 10
    10
      JitsiParticipant.js
  2. 1
    1
      doc/example/example.js
  3. 1483
    990
      lib-jitsi-meet.js
  4. 1
    1
      modules/RTC/JitsiRemoteTrack.js
  5. 1
    1
      modules/xmpp/SDPUtil.js

+ 10
- 10
JitsiParticipant.js Zobrazit soubor

@@ -6,6 +6,8 @@ function JitsiParticipant(id, conference, displayName){
6 6
     this._conference = conference;
7 7
     this._displayName = displayName;
8 8
     this._supportsDTMF = false;
9
+    this._tracks = [];
10
+    this._isModerator = false;
9 11
 }
10 12
 
11 13
 /**
@@ -19,7 +21,7 @@ JitsiParticipant.prototype.getConference = function() {
19 21
  * @returns {Array.<JitsiTrack>} The list of media tracks for this participant.
20 22
  */
21 23
 JitsiParticipant.prototype.getTracks = function() {
22
-
24
+    return this._tracks;
23 25
 };
24 26
 
25 27
 /**
@@ -40,6 +42,7 @@ JitsiParticipant.prototype.getDisplayName = function() {
40 42
  * @returns {Boolean} Whether this participant is a moderator or not.
41 43
  */
42 44
 JitsiParticipant.prototype.isModerator = function() {
45
+    return this._isModerator;
43 46
 };
44 47
 
45 48
 // Gets a link to an etherpad instance advertised by the participant?
@@ -52,14 +55,18 @@ JitsiParticipant.prototype.isModerator = function() {
52 55
  * @returns {Boolean} Whether this participant has muted their audio.
53 56
  */
54 57
 JitsiParticipant.prototype.isAudioMuted = function() {
55
-
58
+    return this.getTracks().reduce(function (track, isAudioMuted) {
59
+        return isAudioMuted && (track.isVideoTrack() || track.isMuted());
60
+    }, true);
56 61
 };
57 62
 
58 63
 /*
59 64
  * @returns {Boolean} Whether this participant has muted their video.
60 65
  */
61 66
 JitsiParticipant.prototype.isVideoMuted = function() {
62
-
67
+    return this.getTracks().reduce(function (track, isVideoMuted) {
68
+        return isVideoMuted && (track.isAudioTrack() || track.isMuted());
69
+    }, true);
63 70
 };
64 71
 
65 72
 /*
@@ -98,13 +105,6 @@ JitsiParticipant.prototype.isSipGateway = function() {
98 105
 
99 106
 };
100 107
 
101
-/**
102
- * @returns {String} The ID for this participant's avatar.
103
- */
104
-JitsiParticipant.prototype.getAvatarId = function() {
105
-
106
-};
107
-
108 108
 /**
109 109
  * @returns {Boolean} Whether this participant is currently sharing their screen.
110 110
  */

+ 1
- 1
doc/example/example.js Zobrazit soubor

@@ -50,7 +50,7 @@ function onLocalTracks(tracks)
50 50
 function onRemoteTrack(track) {
51 51
     if(track.isLocal())
52 52
         return;
53
-    var participant = track.getParitcipantId();
53
+    var participant = track.getParticipantId();
54 54
     if(!remoteTracks[participant])
55 55
         remoteTracks[participant] = [];
56 56
     var idx = remoteTracks[participant].push(track);

+ 1483
- 990
lib-jitsi-meet.js
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 1
- 1
modules/RTC/JitsiRemoteTrack.js Zobrazit soubor

@@ -53,7 +53,7 @@ JitsiRemoteTrack.prototype.isMuted = function () {
53 53
  * Returns the participant id which owns the track.
54 54
  * @returns {string} the id of the participants.
55 55
  */
56
-JitsiRemoteTrack.prototype.getParitcipantId = function() {
56
+JitsiRemoteTrack.prototype.getParticipantId = function() {
57 57
     return Strophe.getResourceFromJid(this.peerjid);
58 58
 };
59 59
 

+ 1
- 1
modules/xmpp/SDPUtil.js Zobrazit soubor

@@ -1,4 +1,3 @@
1
-
2 1
 var logger = require("jitsi-meet-logger").getLogger(__filename);
3 2
 var RTCBrowserType = require("../RTC/RTCBrowserType");
4 3
 
@@ -361,4 +360,5 @@ SDPUtil = {
361 360
         return line + '\r\n';
362 361
     }
363 362
 };
363
+
364 364
 module.exports = SDPUtil;

Načítá se…
Zrušit
Uložit