Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

JitsiParticipant.js 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /* global Strophe */
  2. /**
  3. * Represents a participant in (a member of) a conference.
  4. */
  5. function JitsiParticipant(jid, conference, displayName){
  6. this._jid = jid;
  7. this._id = Strophe.getResourceFromJid(jid);
  8. this._conference = conference;
  9. this._displayName = displayName;
  10. this._supportsDTMF = false;
  11. this._tracks = [];
  12. this._role = 'none';
  13. this._status = null;
  14. this._availableDevices = {
  15. audio: undefined,
  16. video: undefined
  17. };
  18. }
  19. /**
  20. * @returns {JitsiConference} The conference that this participant belongs to.
  21. */
  22. JitsiParticipant.prototype.getConference = function() {
  23. return this._conference;
  24. };
  25. /**
  26. * @returns {Array.<JitsiTrack>} The list of media tracks for this participant.
  27. */
  28. JitsiParticipant.prototype.getTracks = function() {
  29. return this._tracks.slice();
  30. };
  31. /**
  32. * @returns {String} The ID of this participant.
  33. */
  34. JitsiParticipant.prototype.getId = function() {
  35. return this._id;
  36. };
  37. /**
  38. * @returns {String} The JID of this participant.
  39. */
  40. JitsiParticipant.prototype.getJid = function() {
  41. return this._jid;
  42. };
  43. /**
  44. * @returns {String} The human-readable display name of this participant.
  45. */
  46. JitsiParticipant.prototype.getDisplayName = function() {
  47. return this._displayName;
  48. };
  49. /**
  50. * @returns {String} The status of the participant.
  51. */
  52. JitsiParticipant.prototype.getStatus = function () {
  53. return this._status;
  54. };
  55. /**
  56. * @returns {Boolean} Whether this participant is a moderator or not.
  57. */
  58. JitsiParticipant.prototype.isModerator = function() {
  59. return this._role === 'moderator';
  60. };
  61. // Gets a link to an etherpad instance advertised by the participant?
  62. //JitsiParticipant.prototype.getEtherpad = function() {
  63. //
  64. //}
  65. /*
  66. * @returns {Boolean} Whether this participant has muted their audio.
  67. */
  68. JitsiParticipant.prototype.isAudioMuted = function() {
  69. return this.getTracks().reduce(function (track, isAudioMuted) {
  70. return isAudioMuted && (track.isVideoTrack() || track.isMuted());
  71. }, true);
  72. };
  73. /*
  74. * @returns {Boolean} Whether this participant has muted their video.
  75. */
  76. JitsiParticipant.prototype.isVideoMuted = function() {
  77. return this.getTracks().reduce(function (track, isVideoMuted) {
  78. return isVideoMuted && (track.isAudioTrack() || track.isMuted());
  79. }, true);
  80. };
  81. /*
  82. * @returns {???} The latest statistics reported by this participant
  83. * (i.e. info used to populate the GSM bars)
  84. * TODO: do we expose this or handle it internally?
  85. */
  86. JitsiParticipant.prototype.getLatestStats = function() {
  87. };
  88. /**
  89. * @returns {String} The role of this participant.
  90. */
  91. JitsiParticipant.prototype.getRole = function() {
  92. return this._role;
  93. };
  94. /*
  95. * @returns {Boolean} Whether this participant is
  96. * the conference focus (i.e. jicofo).
  97. */
  98. JitsiParticipant.prototype.isFocus = function() {
  99. };
  100. /*
  101. * @returns {Boolean} Whether this participant is
  102. * a conference recorder (i.e. jirecon).
  103. */
  104. JitsiParticipant.prototype.isRecorder = function() {
  105. };
  106. /*
  107. * @returns {Boolean} Whether this participant is a SIP gateway (i.e. jigasi).
  108. */
  109. JitsiParticipant.prototype.isSipGateway = function() {
  110. };
  111. /**
  112. * @returns {Boolean} Whether this participant
  113. * is currently sharing their screen.
  114. */
  115. JitsiParticipant.prototype.isScreenSharing = function() {
  116. };
  117. /**
  118. * @returns {String} The user agent of this participant
  119. * (i.e. browser userAgent string).
  120. */
  121. JitsiParticipant.prototype.getUserAgent = function() {
  122. };
  123. /**
  124. * Kicks the participant from the conference (requires certain privileges).
  125. */
  126. JitsiParticipant.prototype.kick = function() {
  127. };
  128. /**
  129. * Asks this participant to mute themselves.
  130. */
  131. JitsiParticipant.prototype.askToMute = function() {
  132. };
  133. JitsiParticipant.prototype.supportsDTMF = function () {
  134. return this._supportsDTMF;
  135. };
  136. module.exports = JitsiParticipant;