modified lib-jitsi-meet dev repo
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

JitsiParticipant.js 3.2KB

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