Browse Source

use JitsiParticipant; add some method implementations

dev1
isymchych 9 years ago
parent
commit
56328fcf58
5 changed files with 1496 additions and 1003 deletions
  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 View File

6
     this._conference = conference;
6
     this._conference = conference;
7
     this._displayName = displayName;
7
     this._displayName = displayName;
8
     this._supportsDTMF = false;
8
     this._supportsDTMF = false;
9
+    this._tracks = [];
10
+    this._isModerator = false;
9
 }
11
 }
10
 
12
 
11
 /**
13
 /**
19
  * @returns {Array.<JitsiTrack>} The list of media tracks for this participant.
21
  * @returns {Array.<JitsiTrack>} The list of media tracks for this participant.
20
  */
22
  */
21
 JitsiParticipant.prototype.getTracks = function() {
23
 JitsiParticipant.prototype.getTracks = function() {
22
-
24
+    return this._tracks;
23
 };
25
 };
24
 
26
 
25
 /**
27
 /**
40
  * @returns {Boolean} Whether this participant is a moderator or not.
42
  * @returns {Boolean} Whether this participant is a moderator or not.
41
  */
43
  */
42
 JitsiParticipant.prototype.isModerator = function() {
44
 JitsiParticipant.prototype.isModerator = function() {
45
+    return this._isModerator;
43
 };
46
 };
44
 
47
 
45
 // Gets a link to an etherpad instance advertised by the participant?
48
 // Gets a link to an etherpad instance advertised by the participant?
52
  * @returns {Boolean} Whether this participant has muted their audio.
55
  * @returns {Boolean} Whether this participant has muted their audio.
53
  */
56
  */
54
 JitsiParticipant.prototype.isAudioMuted = function() {
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
  * @returns {Boolean} Whether this participant has muted their video.
64
  * @returns {Boolean} Whether this participant has muted their video.
60
  */
65
  */
61
 JitsiParticipant.prototype.isVideoMuted = function() {
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
 
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
  * @returns {Boolean} Whether this participant is currently sharing their screen.
109
  * @returns {Boolean} Whether this participant is currently sharing their screen.
110
  */
110
  */

+ 1
- 1
doc/example/example.js View File

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

+ 1483
- 990
lib-jitsi-meet.js
File diff suppressed because it is too large
View File


+ 1
- 1
modules/RTC/JitsiRemoteTrack.js View File

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

+ 1
- 1
modules/xmpp/SDPUtil.js View File

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

Loading…
Cancel
Save