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

2.6.10: Add missing methods and events in PlainRtpTransport.js

上级 1dff48b3
# Changelog # Changelog
### 2.6.10
* `PlainRtpTransport.js`: Add missing methods and events.
### 2.6.9 ### 2.6.9
* Remove a potential crash if a single `encoding` is given in the Producer `rtpParameters` and it has a `profile` value. * Remove a potential crash if a single `encoding` is given in the Producer `rtpParameters` and it has a `profile` value.
......
...@@ -66,9 +66,10 @@ class PlainRtpTransport extends EnhancedEventEmitter ...@@ -66,9 +66,10 @@ class PlainRtpTransport extends EnhancedEventEmitter
/** /**
* Close the PlainRtpTransport. * Close the PlainRtpTransport.
* *
* @param {Any} [appData] - App custom data.
* @param {Boolean} [notifyChannel=true] - Private. * @param {Boolean} [notifyChannel=true] - Private.
*/ */
close(notifyChannel = true) close(appData, notifyChannel = true)
{ {
logger.debug('close()'); logger.debug('close()');
...@@ -77,8 +78,40 @@ class PlainRtpTransport extends EnhancedEventEmitter ...@@ -77,8 +78,40 @@ class PlainRtpTransport extends EnhancedEventEmitter
this._closed = true; this._closed = true;
this.emit('@notify', 'transportClosed', { id: this.id, appData });
this.emit('@close'); this.emit('@close');
this.safeEmit('close', 'local', appData);
this._destroy(notifyChannel);
}
/**
* Remote PlainRtpTransport was closed.
* Invoked via remote notification.
*
* @private
*
* @param {Any} [appData] - App custom data.
* @param {Boolean} [notifyChannel=true] - Private.
*/
remoteClose(appData, notifyChannel = true)
{
logger.debug('remoteClose()');
if (this._closed)
return;
this._closed = true;
this.emit('@close');
this.safeEmit('close', 'remote', appData);
this._destroy(notifyChannel);
}
_destroy(notifyChannel = true)
{
// Remove notification subscriptions. // Remove notification subscriptions.
this._channel.removeAllListeners(this._internal.transportId); this._channel.removeAllListeners(this._internal.transportId);
......
{ {
"name": "mediasoup", "name": "mediasoup",
"version": "2.6.9", "version": "2.6.10",
"description": "Cutting Edge WebRTC Video Conferencing", "description": "Cutting Edge WebRTC Video Conferencing",
"author": "Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)", "author": "Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)",
"contributors": [ "contributors": [
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论