Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

JitsiParticipant.js 3.6KB

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