Skip to content

Commit

Permalink
Add speaker event timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry2013 committed Jan 14, 2025
1 parent 36dbfdf commit bed9d70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions JitsiConferenceEventManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,13 @@ JitsiConferenceEventManager.prototype.setupRTCListeners = function() {
conference.onRemoteTrackRemoved.bind(conference));

rtc.addListener(RTCEvents.DOMINANT_SPEAKER_CHANGED,
(dominant, previous, silence) => {
(dominant, previous, silence, timestamp) => {
if ((conference.lastDominantSpeaker !== dominant || conference.dominantSpeakerIsSilent !== silence)
&& conference.room) {
conference.lastDominantSpeaker = dominant;
conference.dominantSpeakerIsSilent = silence;
conference.eventEmitter.emit(
JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED, dominant, previous, silence);
JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED, dominant, previous, silence, timestamp);
if (conference.statistics && conference.myUserId() === dominant) {
// We are the new dominant speaker.
conference.xmpp.sendDominantSpeakerEvent(conference.room.roomjid, silence);
Expand Down
4 changes: 2 additions & 2 deletions modules/RTC/BridgeChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ export default class BridgeChannel {

switch (colibriClass) {
case 'DominantSpeakerEndpointChangeEvent': {
const { dominantSpeakerEndpoint, previousSpeakers = [], silence } = obj;
const { dominantSpeakerEndpoint, previousSpeakers = [], silence, timestamp: t } = obj;

logger.debug(`Dominant speaker: ${dominantSpeakerEndpoint}, previous speakers: ${previousSpeakers}`);
emitter.emit(RTCEvents.DOMINANT_SPEAKER_CHANGED, dominantSpeakerEndpoint, previousSpeakers, silence);
emitter.emit(RTCEvents.DOMINANT_SPEAKER_CHANGED, dominantSpeakerEndpoint, previousSpeakers, silence, t);
break;
}
case 'EndpointConnectivityStatusChangeEvent': {
Expand Down

0 comments on commit bed9d70

Please sign in to comment.