|
@@ -63,6 +63,7 @@ function JitsiConference(options) {
|
63
|
63
|
video: undefined
|
64
|
64
|
};
|
65
|
65
|
this.isMutedByFocus = false;
|
|
66
|
+ this.reportedAudioSSRCs = {};
|
66
|
67
|
}
|
67
|
68
|
|
68
|
69
|
/**
|
|
@@ -151,6 +152,8 @@ JitsiConference.prototype._leaveRoomAndRemoveParticipants = function () {
|
151
|
152
|
}
|
152
|
153
|
|
153
|
154
|
this.room = null;
|
|
155
|
+
|
|
156
|
+ this.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_LEFT);
|
154
|
157
|
}
|
155
|
158
|
/**
|
156
|
159
|
* Leaves the conference.
|
|
@@ -371,7 +374,8 @@ JitsiConference.prototype.setSubject = function (subject) {
|
371
|
374
|
*/
|
372
|
375
|
JitsiConference.prototype.addTrack = function (track) {
|
373
|
376
|
if (track.disposed) {
|
374
|
|
- throw new JitsiTrackError(JitsiTrackErrors.TRACK_IS_DISPOSED);
|
|
377
|
+ return Promise.reject(
|
|
378
|
+ new JitsiTrackError(JitsiTrackErrors.TRACK_IS_DISPOSED));
|
375
|
379
|
}
|
376
|
380
|
|
377
|
381
|
if (track.isVideoTrack()) {
|
|
@@ -383,8 +387,8 @@ JitsiConference.prototype.addTrack = function (track) {
|
383
|
387
|
if (track === localVideoTrack) {
|
384
|
388
|
return Promise.resolve(track);
|
385
|
389
|
} else {
|
386
|
|
- throw new Error(
|
387
|
|
- "cannot add second video track to the conference");
|
|
390
|
+ return Promise.reject(new Error(
|
|
391
|
+ "cannot add second video track to the conference"));
|
388
|
392
|
}
|
389
|
393
|
}
|
390
|
394
|
}
|
|
@@ -488,9 +492,9 @@ JitsiConference.prototype._fireMuteChangeEvent = function (track) {
|
488
|
492
|
* @returns {Promise}
|
489
|
493
|
*/
|
490
|
494
|
JitsiConference.prototype.removeTrack = function (track) {
|
491
|
|
- if(track.disposed)
|
492
|
|
- {
|
493
|
|
- throw new Error(JitsiTrackErrors.TRACK_IS_DISPOSED);
|
|
495
|
+ if (track.disposed) {
|
|
496
|
+ return Promise.reject(
|
|
497
|
+ new JitsiTrackError(JitsiTrackErrors.TRACK_IS_DISPOSED));
|
494
|
498
|
}
|
495
|
499
|
|
496
|
500
|
if(!this.room){
|
|
@@ -1096,6 +1100,63 @@ JitsiConference.prototype._onTrackAttach = function(track, container) {
|
1096
|
1100
|
ssrc, track.isLocal(), track.getUsageLabel(), container.id);
|
1097
|
1101
|
}
|
1098
|
1102
|
|
|
1103
|
+/**
|
|
1104
|
+ * Reports detected audio problem with the media stream related to the passed
|
|
1105
|
+ * ssrc.
|
|
1106
|
+ * @param ssrc {string} the ssrc
|
|
1107
|
+ */
|
|
1108
|
+JitsiConference.prototype._reportAudioProblem = function (ssrc) {
|
|
1109
|
+ if(this.reportedAudioSSRCs[ssrc])
|
|
1110
|
+ return;
|
|
1111
|
+ var track = this.rtc.getRemoteTrackBySSRC(ssrc);
|
|
1112
|
+ if(!track || !track.isAudioTrack())
|
|
1113
|
+ return;
|
|
1114
|
+
|
|
1115
|
+ this.reportedAudioSSRCs[ssrc] = true;
|
|
1116
|
+ var errorContent = {
|
|
1117
|
+ errMsg: "The audio is received but not played",
|
|
1118
|
+ ssrc: ssrc
|
|
1119
|
+ };
|
|
1120
|
+
|
|
1121
|
+ var mstream = track.stream, mtrack = track.track;
|
|
1122
|
+ if(mstream) {
|
|
1123
|
+ errorContent.MediaStream = {
|
|
1124
|
+ active: mstream.active,
|
|
1125
|
+ id: mstream.id
|
|
1126
|
+ }
|
|
1127
|
+ }
|
|
1128
|
+
|
|
1129
|
+ if(mtrack) {
|
|
1130
|
+ errorContent.MediaStreamTrack = {
|
|
1131
|
+ enabled: mtrack.enabled,
|
|
1132
|
+ id: mtrack.id,
|
|
1133
|
+ label: mtrack.label,
|
|
1134
|
+ muted: mtrack.muted
|
|
1135
|
+ }
|
|
1136
|
+ }
|
|
1137
|
+
|
|
1138
|
+ if(track.containers) {
|
|
1139
|
+ errorContent.containers = [];
|
|
1140
|
+ track.containers.forEach(function (container) {
|
|
1141
|
+ errorContent.containers.push({
|
|
1142
|
+ autoplay: container.autoplay,
|
|
1143
|
+ muted: container.muted,
|
|
1144
|
+ src: container.src,
|
|
1145
|
+ volume: container.volume,
|
|
1146
|
+ id: container.id,
|
|
1147
|
+ ended: container.ended,
|
|
1148
|
+ paused: container.paused,
|
|
1149
|
+ readyState: container.readyState
|
|
1150
|
+ });
|
|
1151
|
+ });
|
|
1152
|
+ }
|
|
1153
|
+
|
|
1154
|
+ this.statistics.sendDetectedAudioProblem(
|
|
1155
|
+ new Error(JSON.stringify(errorContent)));
|
|
1156
|
+ logger.error("Audio problem detected. The audio is received but not played",
|
|
1157
|
+ errorContent);
|
|
1158
|
+}
|
|
1159
|
+
|
1099
|
1160
|
/**
|
1100
|
1161
|
* Setups the listeners needed for the conference.
|
1101
|
1162
|
*/
|