提交 c748af2f authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

ActiveSpeakerDetector: Also report the Producer in the 'activespeakerchange' event.

上级 5e3c21b0
......@@ -44,12 +44,15 @@ class Peer extends EnhancedEventEmitter
this._appData = undefined;
// Map of Transports indexed by id.
// @type {Map<transportId, Transports>}
this._transports = new Map();
// Map of Producers indexed by id.
// @type {Map<producerId, Producer>}
this._producers = new Map();
// Map of Consumers indexed by id.
// @type {Map<consumerId, Consumers>}
this._consumers = new Map();
}
......
......@@ -30,11 +30,12 @@ class Room extends EnhancedEventEmitter
// Channel instance.
this._channel = channel;
// Map of Peer instances indexed by `peerName`.
// Map of Peer instances indexed by peerName.
// @type {Map<peerName, Peer>}
this._peers = new Map();
// TODO: Yes?
// Map of Producer instances indexed by `producerId`.
// Map of Producer instances indexed by producerId.
// @type {Map<producerId, Producer>}
this._producers = new Map();
this._handleWorkerNotifications();
......
......@@ -132,7 +132,7 @@ class ActiveSpeakerDetector extends EnhancedEventEmitter
logger.debug(
'emitting "activespeakerchange" [peerName:"%s"]', peer.name);
this.safeEmit('activespeakerchange', peer);
this.safeEmit('activespeakerchange', peer, this._activeProducer);
}
// Otherwise, if the previous active speaker (if any) is closed or paused,
// unset it.
......@@ -145,7 +145,7 @@ class ActiveSpeakerDetector extends EnhancedEventEmitter
logger.debug(
'emitting "activespeakerchange" [peerName:null]');
this.safeEmit('activespeakerchange', null);
this.safeEmit('activespeakerchange', null, null);
}
}
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论