Commit 8cf3d22 1 parent 73766e6 commit 8cf3d22 Copy full SHA for 8cf3d22
File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ export class WHEPClient extends EventTarget
21
21
//Pending candidadtes
22
22
this . candidates = [ ] ;
23
23
this . endOfcandidates = false ;
24
+
25
+ this . onOffer = offer => offer ;
26
+ this . onAnswer = answer => answer ;
24
27
}
25
28
26
29
async view ( pc , url , token )
@@ -73,6 +76,7 @@ export class WHEPClient extends EventTarget
73
76
}
74
77
//Create SDP offer
75
78
const offer = await pc . createOffer ( ) ;
79
+ offer . sdp = this . onOffer ( offer . sdp ) ;
76
80
77
81
//Request headers
78
82
const headers = {
@@ -261,7 +265,7 @@ export class WHEPClient extends EventTarget
261
265
//}
262
266
263
267
//And set remote description
264
- await pc . setRemoteDescription ( { type : "answer" , sdp : answer } ) ;
268
+ await pc . setRemoteDescription ( { type : "answer" , sdp : this . onAnswer ( answer ) } ) ;
265
269
}
266
270
267
271
async restart ( )
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ export class WHIPClient
12
12
//Pending candidadtes
13
13
this . candidates = [ ] ;
14
14
this . endOfcandidates = false ;
15
+
16
+ this . onOffer = offer => offer ;
17
+ this . onAnswer = answer => answer ;
15
18
}
16
19
17
20
async publish ( pc , url , token )
@@ -64,6 +67,7 @@ export class WHIPClient
64
67
}
65
68
//Create SDP offer
66
69
const offer = await pc . createOffer ( ) ;
70
+ offer . sdp = this . onOffer ( offer . sdp ) ;
67
71
68
72
//Request headers
69
73
const headers = {
@@ -210,7 +214,7 @@ export class WHIPClient
210
214
//}
211
215
212
216
//And set remote description
213
- await pc . setRemoteDescription ( { type : "answer" , sdp : answer } ) ;
217
+ await pc . setRemoteDescription ( { type : "answer" , sdp : this . onAnswer ( answer ) } ) ;
214
218
}
215
219
216
220
async restart ( )
You can’t perform that action at this time.
0 commit comments