File tree Expand file tree Collapse file tree
src/content/datachannel/basic/js Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,7 +93,9 @@ function closeDataChannels() {
9393}
9494
9595function gotDescription1 ( desc ) {
96- pc1 . setLocalDescription ( desc ) ;
96+ pc1 . setLocalDescription ( desc ) . then ( ( ) => {
97+ pc1 . sctp . onstatechange = ( ) => console . log ( 'PC1 SCTP state' , pc1 . sctp . state ) ;
98+ } ) ;
9799 console . log ( `Offer from pc1\n${ desc . sdp } ` ) ;
98100 pc2 . setRemoteDescription ( desc ) ;
99101 pc2 . createAnswer ( ) . then (
@@ -103,7 +105,9 @@ function gotDescription1(desc) {
103105}
104106
105107function gotDescription2 ( desc ) {
106- pc2 . setLocalDescription ( desc ) ;
108+ pc2 . setLocalDescription ( desc ) . then ( ( ) => {
109+ pc2 . sctp . onstatechange = ( ) => console . log ( 'PC2 SCTP state' , pc2 . sctp . state ) ;
110+ } ) ;
107111 console . log ( `Answer from pc2\n${ desc . sdp } ` ) ;
108112 pc1 . setRemoteDescription ( desc ) ;
109113}
You can’t perform that action at this time.
0 commit comments