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