@@ -75,19 +75,19 @@ export class Session {
7575 /**
7676 * See {@link https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/ondatachannel}
7777 */
78- public ondatachannel : RTCPeerConnection [ "ondatachannel" ] = ( ) => { } ;
78+ public ondatachannel : RTCPeerConnection [ "ondatachannel" ] = ( ) => { } ;
7979
8080 /**
8181 * See {@link https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/onconnectionstatechange}
8282 */
8383 public onconnectionstatechange : RTCPeerConnection [ "onconnectionstatechange" ] =
84- ( ) => { } ;
84+ ( ) => { } ;
8585
8686 /**
8787 * Callback invoked when a new media track is added to the connection.
8888 * See {@link https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/ontrack}
8989 */
90- public ontrack : RTCPeerConnection [ "ontrack" ] = ( ) => { } ;
90+ public ontrack : RTCPeerConnection [ "ontrack" ] = ( ) => { } ;
9191
9292 /**
9393 * Adds a media track to the connection.
@@ -183,6 +183,7 @@ export class Session {
183183
184184 this . logger . debug ( "session closed" , {
185185 connectionState : this . connectionState ,
186+ reason,
186187 } ) ;
187188 }
188189
@@ -274,10 +275,9 @@ export class Session {
274275 break ;
275276 }
276277 case "disconnected" :
277- this . triggerIceRestart ( ) ;
278278 break ;
279279 case "failed" :
280- this . close ( "connection failed" ) ;
280+ this . triggerIceRestart ( ) ;
281281 break ;
282282 case "closed" :
283283 break ;
@@ -423,9 +423,9 @@ export class Session {
423423 }
424424
425425 private triggerIceRestart = ( ) => {
426- // the impolite offer will trigger the polite peer's to also restart Ice
427- if ( ! this . impolite ) return ;
428-
426+ // // the impolite offer will trigger the polite peer's to also restart Ice
427+ // if (!this.impolite) return;
428+ //
429429 const elapsed = performance . now ( ) - this . lastIceRestart ;
430430 if ( elapsed < ICE_RESTART_DEBOUNCE_DELAY_MS ) {
431431 // schedule ice restart after some delay;
0 commit comments