File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -56,22 +56,22 @@ const App = () => {
5656 socket . send (
5757 JSON . stringify ( {
5858 event : "candidate" ,
59- data : JSON . stringify ( e . candidate ) ,
59+ data : e . candidate ,
6060 } )
6161 ) ;
6262 }
6363 } ;
6464
6565 if ( socket ) {
6666 socket . onmessage = async ( event ) => {
67- const msg = JSON . parse ( event . data ) ;
67+ const msg = event . data ;
6868
6969 if ( ! msg ) {
7070 console . log ( "Failed to parse msg" ) ;
7171 return ;
7272 }
7373
74- const offerCandidate = JSON . parse ( msg . data ) ;
74+ const offerCandidate = msg . data ;
7575
7676 if ( ! offerCandidate ) {
7777 console . log ( "Failed to parse offer msg data" ) ;
@@ -89,7 +89,7 @@ const App = () => {
8989 socket . send (
9090 JSON . stringify ( {
9191 event : "answer" ,
92- data : JSON . stringify ( answer ) ,
92+ data : answer ,
9393 } )
9494 ) ;
9595 } catch ( e ) {
@@ -104,7 +104,7 @@ const App = () => {
104104 case "info" :
105105 dispatch ( {
106106 type : "info" ,
107- viewers : JSON . parse ( msg . data ) . no_connections ,
107+ viewers : msg . data . no_connections ,
108108 } ) ;
109109 }
110110 } ;
You can’t perform that action at this time.
0 commit comments