werift 0.26.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (552) hide show
  1. package/README.md +182 -8
  2. package/THIRD_PARTY_LICENSES_LIBWEBRTC.txt +58 -0
  3. package/lib/common/src/binary.d.ts +1 -3
  4. package/lib/common/src/binary.js +8 -6
  5. package/lib/common/src/binary.js.map +1 -1
  6. package/lib/common/src/binaryData.js +2 -1
  7. package/lib/common/src/binaryData.js.map +1 -1
  8. package/lib/common/src/event.d.ts +26 -0
  9. package/lib/common/src/event.js +87 -2
  10. package/lib/common/src/event.js.map +1 -1
  11. package/lib/common/src/log.js +5 -7
  12. package/lib/common/src/log.js.map +1 -1
  13. package/lib/common/src/network.d.ts +6 -1
  14. package/lib/common/src/network.js +8 -2
  15. package/lib/common/src/network.js.map +1 -1
  16. package/lib/common/src/transport.d.ts +12 -5
  17. package/lib/common/src/transport.js +13 -7
  18. package/lib/common/src/transport.js.map +1 -1
  19. package/lib/dtls/src/alert.d.ts +49 -0
  20. package/lib/dtls/src/alert.js +103 -0
  21. package/lib/dtls/src/alert.js.map +1 -0
  22. package/lib/dtls/src/client.js +15 -1
  23. package/lib/dtls/src/client.js.map +1 -1
  24. package/lib/dtls/src/context/cipher.d.ts +1 -1
  25. package/lib/dtls/src/context/cipher.js +6 -3
  26. package/lib/dtls/src/context/cipher.js.map +1 -1
  27. package/lib/dtls/src/context/dtls.d.ts +2 -0
  28. package/lib/dtls/src/context/dtls.js +11 -2
  29. package/lib/dtls/src/context/dtls.js.map +1 -1
  30. package/lib/dtls/src/context/transport.d.ts +17 -1
  31. package/lib/dtls/src/context/transport.js +40 -3
  32. package/lib/dtls/src/context/transport.js.map +1 -1
  33. package/lib/dtls/src/flight/client/flight1.js +2 -1
  34. package/lib/dtls/src/flight/client/flight1.js.map +1 -1
  35. package/lib/dtls/src/flight/client/flight5.js +8 -3
  36. package/lib/dtls/src/flight/client/flight5.js.map +1 -1
  37. package/lib/dtls/src/flight/flight.d.ts +6 -1
  38. package/lib/dtls/src/flight/flight.js +18 -5
  39. package/lib/dtls/src/flight/flight.js.map +1 -1
  40. package/lib/dtls/src/flight/server/flight4.js +4 -2
  41. package/lib/dtls/src/flight/server/flight4.js.map +1 -1
  42. package/lib/dtls/src/flight/server/flight6.js +6 -2
  43. package/lib/dtls/src/flight/server/flight6.js.map +1 -1
  44. package/lib/dtls/src/handshake/const.d.ts +17 -13
  45. package/lib/dtls/src/handshake/const.js +16 -14
  46. package/lib/dtls/src/handshake/const.js.map +1 -1
  47. package/lib/dtls/src/handshake/message/alert.js +4 -2
  48. package/lib/dtls/src/handshake/message/alert.js.map +1 -1
  49. package/lib/dtls/src/handshake/message/certificate.js +2 -1
  50. package/lib/dtls/src/handshake/message/certificate.js.map +1 -1
  51. package/lib/dtls/src/handshake/message/changeCipherSpec.js +2 -1
  52. package/lib/dtls/src/handshake/message/changeCipherSpec.js.map +1 -1
  53. package/lib/dtls/src/handshake/message/client/certificateVerify.js +4 -2
  54. package/lib/dtls/src/handshake/message/client/certificateVerify.js.map +1 -1
  55. package/lib/dtls/src/handshake/message/client/hello.js +14 -7
  56. package/lib/dtls/src/handshake/message/client/hello.js.map +1 -1
  57. package/lib/dtls/src/handshake/message/client/keyExchange.js +2 -1
  58. package/lib/dtls/src/handshake/message/client/keyExchange.js.map +1 -1
  59. package/lib/dtls/src/handshake/message/finished.js +2 -1
  60. package/lib/dtls/src/handshake/message/finished.js.map +1 -1
  61. package/lib/dtls/src/handshake/message/server/certificateRequest.js +6 -3
  62. package/lib/dtls/src/handshake/message/server/certificateRequest.js.map +1 -1
  63. package/lib/dtls/src/handshake/message/server/hello.js +12 -6
  64. package/lib/dtls/src/handshake/message/server/hello.js.map +1 -1
  65. package/lib/dtls/src/handshake/message/server/helloDone.js.map +1 -1
  66. package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js +4 -2
  67. package/lib/dtls/src/handshake/message/server/helloVerifyRequest.js.map +1 -1
  68. package/lib/dtls/src/handshake/message/server/keyExchange.js +16 -8
  69. package/lib/dtls/src/handshake/message/server/keyExchange.js.map +1 -1
  70. package/lib/dtls/src/handshake/random.d.ts +2 -2
  71. package/lib/dtls/src/handshake/random.js +5 -2
  72. package/lib/dtls/src/handshake/random.js.map +1 -1
  73. package/lib/dtls/src/index.d.ts +3 -1
  74. package/lib/dtls/src/index.js +10 -1
  75. package/lib/dtls/src/index.js.map +1 -1
  76. package/lib/dtls/src/record/const.d.ts +52 -33
  77. package/lib/dtls/src/record/const.js +51 -36
  78. package/lib/dtls/src/record/const.js.map +1 -1
  79. package/lib/dtls/src/record/message/fragment.js +12 -6
  80. package/lib/dtls/src/record/message/fragment.js.map +1 -1
  81. package/lib/dtls/src/record/message/header.js +10 -5
  82. package/lib/dtls/src/record/message/header.js.map +1 -1
  83. package/lib/dtls/src/record/message/plaintext.js +4 -2
  84. package/lib/dtls/src/record/message/plaintext.js.map +1 -1
  85. package/lib/dtls/src/record/receive.d.ts +6 -0
  86. package/lib/dtls/src/record/receive.js +50 -19
  87. package/lib/dtls/src/record/receive.js.map +1 -1
  88. package/lib/dtls/src/server.js +19 -1
  89. package/lib/dtls/src/server.js.map +1 -1
  90. package/lib/dtls/src/socket.d.ts +134 -2
  91. package/lib/dtls/src/socket.js +326 -8
  92. package/lib/dtls/src/socket.js.map +1 -1
  93. package/lib/ice/src/candidate.d.ts +1 -1
  94. package/lib/ice/src/candidate.js +24 -12
  95. package/lib/ice/src/candidate.js.map +1 -1
  96. package/lib/ice/src/candidateError.d.ts +155 -0
  97. package/lib/ice/src/candidateError.js +246 -0
  98. package/lib/ice/src/candidateError.js.map +1 -0
  99. package/lib/ice/src/candidateGatherer.d.ts +127 -0
  100. package/lib/ice/src/candidateGatherer.js +745 -0
  101. package/lib/ice/src/candidateGatherer.js.map +1 -0
  102. package/lib/ice/src/consent.d.ts +49 -0
  103. package/lib/ice/src/consent.js +258 -0
  104. package/lib/ice/src/consent.js.map +1 -0
  105. package/lib/ice/src/dns/lookup.d.ts +10 -1
  106. package/lib/ice/src/dns/lookup.js +42 -7
  107. package/lib/ice/src/dns/lookup.js.map +1 -1
  108. package/lib/ice/src/exceptions.d.ts +21 -5
  109. package/lib/ice/src/exceptions.js +58 -13
  110. package/lib/ice/src/exceptions.js.map +1 -1
  111. package/lib/ice/src/ice.d.ts +254 -58
  112. package/lib/ice/src/ice.js +979 -945
  113. package/lib/ice/src/ice.js.map +1 -1
  114. package/lib/ice/src/iceBase.d.ts +328 -14
  115. package/lib/ice/src/iceBase.js +254 -38
  116. package/lib/ice/src/iceBase.js.map +1 -1
  117. package/lib/ice/src/index.d.ts +1 -0
  118. package/lib/ice/src/index.js +1 -0
  119. package/lib/ice/src/index.js.map +1 -1
  120. package/lib/ice/src/internal/checkMessages.d.ts +41 -0
  121. package/lib/ice/src/internal/checkMessages.js +63 -0
  122. package/lib/ice/src/internal/checkMessages.js.map +1 -0
  123. package/lib/ice/src/internal/defaultRoute.d.ts +20 -0
  124. package/lib/ice/src/internal/defaultRoute.js +134 -0
  125. package/lib/ice/src/internal/defaultRoute.js.map +1 -0
  126. package/lib/ice/src/internal/hostInterfaces.d.ts +17 -0
  127. package/lib/ice/src/internal/hostInterfaces.js +77 -0
  128. package/lib/ice/src/internal/hostInterfaces.js.map +1 -0
  129. package/lib/ice/src/internal/hostPreference.d.ts +24 -0
  130. package/lib/ice/src/internal/hostPreference.js +38 -0
  131. package/lib/ice/src/internal/hostPreference.js.map +1 -0
  132. package/lib/ice/src/internal/resolveHostAddresses.d.ts +56 -8
  133. package/lib/ice/src/internal/resolveHostAddresses.js +127 -24
  134. package/lib/ice/src/internal/resolveHostAddresses.js.map +1 -1
  135. package/lib/ice/src/internal/selectAddresses.d.ts +27 -0
  136. package/lib/ice/src/internal/selectAddresses.js +37 -18
  137. package/lib/ice/src/internal/selectAddresses.js.map +1 -1
  138. package/lib/ice/src/nomination/regularNomination.d.ts +200 -0
  139. package/lib/ice/src/nomination/regularNomination.js +311 -0
  140. package/lib/ice/src/nomination/regularNomination.js.map +1 -0
  141. package/lib/ice/src/nomination/selectionReplacement.d.ts +138 -0
  142. package/lib/ice/src/nomination/selectionReplacement.js +371 -0
  143. package/lib/ice/src/nomination/selectionReplacement.js.map +1 -0
  144. package/lib/ice/src/provisional.d.ts +139 -0
  145. package/lib/ice/src/provisional.js +468 -0
  146. package/lib/ice/src/provisional.js.map +1 -0
  147. package/lib/ice/src/stun/protocol.d.ts +9 -2
  148. package/lib/ice/src/stun/protocol.js +16 -17
  149. package/lib/ice/src/stun/protocol.js.map +1 -1
  150. package/lib/ice/src/stun/tcpProtocol.d.ts +1 -1
  151. package/lib/ice/src/stun/tcpProtocol.js +7 -7
  152. package/lib/ice/src/stun/tcpProtocol.js.map +1 -1
  153. package/lib/ice/src/stun/transaction.d.ts +30 -1
  154. package/lib/ice/src/stun/transaction.js +90 -19
  155. package/lib/ice/src/stun/transaction.js.map +1 -1
  156. package/lib/ice/src/turn/credential.d.ts +49 -0
  157. package/lib/ice/src/turn/credential.js +78 -0
  158. package/lib/ice/src/turn/credential.js.map +1 -0
  159. package/lib/ice/src/turn/protocol.d.ts +31 -10
  160. package/lib/ice/src/turn/protocol.js +127 -51
  161. package/lib/ice/src/turn/protocol.js.map +1 -1
  162. package/lib/ice/src/types/model.d.ts +16 -5
  163. package/lib/ice/src/types/model.js.map +1 -1
  164. package/lib/ice-server/src/stun/attributes.d.ts +2 -0
  165. package/lib/ice-server/src/stun/attributes.js +11 -1
  166. package/lib/ice-server/src/stun/attributes.js.map +1 -1
  167. package/lib/ice-server/src/stun/const.d.ts +44 -17
  168. package/lib/ice-server/src/stun/const.js +31 -19
  169. package/lib/ice-server/src/stun/const.js.map +1 -1
  170. package/lib/ice-server/src/stun/message.d.ts +29 -4
  171. package/lib/ice-server/src/stun/message.js +115 -24
  172. package/lib/ice-server/src/stun/message.js.map +1 -1
  173. package/lib/index.mjs +35121 -22337
  174. package/lib/nonstandard/index.mjs +3169 -1399
  175. package/lib/polyfill/dom.mjs +24650 -12365
  176. package/lib/polyfill/index.mjs +24650 -12365
  177. package/lib/rtp/src/codec/assertPayload.d.ts +4 -0
  178. package/lib/rtp/src/codec/assertPayload.js +12 -0
  179. package/lib/rtp/src/codec/assertPayload.js.map +1 -0
  180. package/lib/rtp/src/codec/av1.js +2 -0
  181. package/lib/rtp/src/codec/av1.js.map +1 -1
  182. package/lib/rtp/src/codec/h264.js +35 -43
  183. package/lib/rtp/src/codec/h264.js.map +1 -1
  184. package/lib/rtp/src/codec/vp8.js +11 -5
  185. package/lib/rtp/src/codec/vp8.js.map +1 -1
  186. package/lib/rtp/src/codec/vp9.js +12 -0
  187. package/lib/rtp/src/codec/vp9.js.map +1 -1
  188. package/lib/rtp/src/extra/container/mp4/container.js +2 -1
  189. package/lib/rtp/src/extra/container/mp4/container.js.map +1 -1
  190. package/lib/rtp/src/extra/container/mp4/exp-golomb.js +2 -1
  191. package/lib/rtp/src/extra/container/mp4/exp-golomb.js.map +1 -1
  192. package/lib/rtp/src/extra/container/mp4/h264.d.ts +21 -17
  193. package/lib/rtp/src/extra/container/mp4/h264.js +26 -24
  194. package/lib/rtp/src/extra/container/mp4/h264.js.map +1 -1
  195. package/lib/rtp/src/extra/container/ogg/index.d.ts +1 -0
  196. package/lib/rtp/src/extra/container/ogg/index.js +1 -0
  197. package/lib/rtp/src/extra/container/ogg/index.js.map +1 -1
  198. package/lib/rtp/src/extra/container/ogg/writer.d.ts +90 -0
  199. package/lib/rtp/src/extra/container/ogg/writer.js +300 -0
  200. package/lib/rtp/src/extra/container/ogg/writer.js.map +1 -0
  201. package/lib/rtp/src/extra/container/webm/ebml/ebml.js +6 -3
  202. package/lib/rtp/src/extra/container/webm/ebml/ebml.js.map +1 -1
  203. package/lib/rtp/src/extra/processor/depacketizer.d.ts +5 -0
  204. package/lib/rtp/src/extra/processor/depacketizer.js +28 -2
  205. package/lib/rtp/src/extra/processor/depacketizer.js.map +1 -1
  206. package/lib/rtp/src/extra/processor/dtx.js +4 -2
  207. package/lib/rtp/src/extra/processor/dtx.js.map +1 -1
  208. package/lib/rtp/src/extra/processor/index.d.ts +2 -0
  209. package/lib/rtp/src/extra/processor/index.js +2 -0
  210. package/lib/rtp/src/extra/processor/index.js.map +1 -1
  211. package/lib/rtp/src/extra/processor/jitterBuffer.d.ts +29 -6
  212. package/lib/rtp/src/extra/processor/jitterBuffer.js +101 -111
  213. package/lib/rtp/src/extra/processor/jitterBuffer.js.map +1 -1
  214. package/lib/rtp/src/extra/processor/jitterBufferTransformer.js +2 -1
  215. package/lib/rtp/src/extra/processor/jitterBufferTransformer.js.map +1 -1
  216. package/lib/rtp/src/extra/processor/lipsync.d.ts +63 -0
  217. package/lib/rtp/src/extra/processor/lipsync.js +202 -51
  218. package/lib/rtp/src/extra/processor/lipsync.js.map +1 -1
  219. package/lib/rtp/src/extra/processor/mp4.d.ts +0 -6
  220. package/lib/rtp/src/extra/processor/mp4.js +6 -3
  221. package/lib/rtp/src/extra/processor/mp4.js.map +1 -1
  222. package/lib/rtp/src/extra/processor/mute.js +4 -2
  223. package/lib/rtp/src/extra/processor/mute.js.map +1 -1
  224. package/lib/rtp/src/extra/processor/nack.js +4 -2
  225. package/lib/rtp/src/extra/processor/nack.js.map +1 -1
  226. package/lib/rtp/src/extra/processor/ntpTime.js +4 -6
  227. package/lib/rtp/src/extra/processor/ntpTime.js.map +1 -1
  228. package/lib/rtp/src/extra/processor/ogg.d.ts +72 -0
  229. package/lib/rtp/src/extra/processor/ogg.js +221 -0
  230. package/lib/rtp/src/extra/processor/ogg.js.map +1 -0
  231. package/lib/rtp/src/extra/processor/oggCallback.d.ts +21 -0
  232. package/lib/rtp/src/extra/processor/oggCallback.js +97 -0
  233. package/lib/rtp/src/extra/processor/oggCallback.js.map +1 -0
  234. package/lib/rtp/src/extra/processor/rtpCallback.js +2 -1
  235. package/lib/rtp/src/extra/processor/rtpCallback.js.map +1 -1
  236. package/lib/rtp/src/extra/processor/rtpStream.js +2 -1
  237. package/lib/rtp/src/extra/processor/rtpStream.js.map +1 -1
  238. package/lib/rtp/src/extra/processor/rtpTime.js +2 -1
  239. package/lib/rtp/src/extra/processor/rtpTime.js.map +1 -1
  240. package/lib/rtp/src/extra/processor/webm.js +14 -7
  241. package/lib/rtp/src/extra/processor/webm.js.map +1 -1
  242. package/lib/rtp/src/extra/processor/webmCallback.js.map +1 -1
  243. package/lib/rtp/src/index.d.ts +8 -0
  244. package/lib/rtp/src/index.js +8 -0
  245. package/lib/rtp/src/index.js.map +1 -1
  246. package/lib/rtp/src/rtcp/psfb/fullIntraRequest.d.ts +4 -0
  247. package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js +4 -0
  248. package/lib/rtp/src/rtcp/psfb/fullIntraRequest.js.map +1 -1
  249. package/lib/rtp/src/rtcp/rtcp.js +8 -4
  250. package/lib/rtp/src/rtcp/rtcp.js.map +1 -1
  251. package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.d.ts +58 -0
  252. package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js +143 -0
  253. package/lib/rtp/src/rtcp/rtpfb/transportWideSequence.js.map +1 -0
  254. package/lib/rtp/src/rtcp/rtpfb/twcc.d.ts +35 -13
  255. package/lib/rtp/src/rtcp/rtpfb/twcc.js +132 -54
  256. package/lib/rtp/src/rtcp/rtpfb/twcc.js.map +1 -1
  257. package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.d.ts +13 -0
  258. package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js +29 -0
  259. package/lib/rtp/src/rtcp/rtpfb/twccReceiveTiming.js.map +1 -0
  260. package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.d.ts +41 -0
  261. package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js +89 -0
  262. package/lib/rtp/src/rtcp/rtpfb/twccReferenceTime.js.map +1 -0
  263. package/lib/rtp/src/rtcp/sr.js +1 -0
  264. package/lib/rtp/src/rtcp/sr.js.map +1 -1
  265. package/lib/rtp/src/rtp/continuity.d.ts +49 -0
  266. package/lib/rtp/src/rtp/continuity.js +120 -0
  267. package/lib/rtp/src/rtp/continuity.js.map +1 -0
  268. package/lib/rtp/src/rtp/headerExtension.js +41 -21
  269. package/lib/rtp/src/rtp/headerExtension.js.map +1 -1
  270. package/lib/rtp/src/rtp/padding.d.ts +17 -0
  271. package/lib/rtp/src/rtp/padding.js +37 -0
  272. package/lib/rtp/src/rtp/padding.js.map +1 -0
  273. package/lib/rtp/src/rtp/red/encoder.d.ts +10 -0
  274. package/lib/rtp/src/rtp/red/encoder.js +14 -1
  275. package/lib/rtp/src/rtp/red/encoder.js.map +1 -1
  276. package/lib/rtp/src/rtp/red/packet.js +24 -8
  277. package/lib/rtp/src/rtp/red/packet.js.map +1 -1
  278. package/lib/rtp/src/rtp/rtp.d.ts +24 -1
  279. package/lib/rtp/src/rtp/rtp.js +70 -29
  280. package/lib/rtp/src/rtp/rtp.js.map +1 -1
  281. package/lib/rtp/src/rtp/rtx.js +3 -0
  282. package/lib/rtp/src/rtp/rtx.js.map +1 -1
  283. package/lib/rtp/src/rtp/sendHeaderExtensions.d.ts +36 -0
  284. package/lib/rtp/src/rtp/sendHeaderExtensions.js +85 -0
  285. package/lib/rtp/src/rtp/sendHeaderExtensions.js.map +1 -0
  286. package/lib/rtp/src/rtp/timelineRewriter.d.ts +178 -0
  287. package/lib/rtp/src/rtp/timelineRewriter.js +417 -0
  288. package/lib/rtp/src/rtp/timelineRewriter.js.map +1 -0
  289. package/lib/rtp/src/srtp/cipher/ctr.js +4 -2
  290. package/lib/rtp/src/srtp/cipher/ctr.js.map +1 -1
  291. package/lib/rtp/src/srtp/cipher/index.js +8 -4
  292. package/lib/rtp/src/srtp/cipher/index.js.map +1 -1
  293. package/lib/rtp/src/srtp/context/context.js +6 -3
  294. package/lib/rtp/src/srtp/context/context.js.map +1 -1
  295. package/lib/rtp/src/srtp/context/srtcp.d.ts +1 -1
  296. package/lib/rtp/src/srtp/context/srtcp.js +33 -0
  297. package/lib/rtp/src/srtp/context/srtcp.js.map +1 -1
  298. package/lib/rtp/src/srtp/context/srtp.d.ts +1 -1
  299. package/lib/rtp/src/srtp/context/srtp.js +34 -10
  300. package/lib/rtp/src/srtp/context/srtp.js.map +1 -1
  301. package/lib/rtp/src/srtp/error.d.ts +8 -0
  302. package/lib/rtp/src/srtp/error.js +13 -1
  303. package/lib/rtp/src/srtp/error.js.map +1 -1
  304. package/lib/rtp/src/srtp/packet.js +4 -1
  305. package/lib/rtp/src/srtp/packet.js.map +1 -1
  306. package/lib/rtp/src/srtp/replay.d.ts +24 -0
  307. package/lib/rtp/src/srtp/replay.js +75 -0
  308. package/lib/rtp/src/srtp/replay.js.map +1 -0
  309. package/lib/rtp/src/srtp/session.js +2 -1
  310. package/lib/rtp/src/srtp/session.js.map +1 -1
  311. package/lib/rtp/src/srtp/srtcp.js +2 -1
  312. package/lib/rtp/src/srtp/srtcp.js.map +1 -1
  313. package/lib/rtp/src/srtp/srtp.js +2 -1
  314. package/lib/rtp/src/srtp/srtp.js.map +1 -1
  315. package/lib/rtp/src/util.js +2 -1
  316. package/lib/rtp/src/util.js.map +1 -1
  317. package/lib/sctp/src/chunk.d.ts +5 -0
  318. package/lib/sctp/src/chunk.js +31 -8
  319. package/lib/sctp/src/chunk.js.map +1 -1
  320. package/lib/sctp/src/const.d.ts +25 -17
  321. package/lib/sctp/src/const.js +23 -19
  322. package/lib/sctp/src/const.js.map +1 -1
  323. package/lib/sctp/src/param.d.ts +6 -2
  324. package/lib/sctp/src/param.js +22 -8
  325. package/lib/sctp/src/param.js.map +1 -1
  326. package/lib/sctp/src/sctp.d.ts +85 -0
  327. package/lib/sctp/src/sctp.js +707 -126
  328. package/lib/sctp/src/sctp.js.map +1 -1
  329. package/lib/sctp/src/transport.js +4 -2
  330. package/lib/sctp/src/transport.js.map +1 -1
  331. package/lib/webrtc/src/api/compatibilityOptions.d.ts +33 -0
  332. package/lib/webrtc/src/api/compatibilityOptions.js +33 -0
  333. package/lib/webrtc/src/api/compatibilityOptions.js.map +1 -0
  334. package/lib/webrtc/src/api/peerConfig.d.ts +385 -28
  335. package/lib/webrtc/src/api/peerConfig.js +121 -14
  336. package/lib/webrtc/src/api/peerConfig.js.map +1 -1
  337. package/lib/webrtc/src/api/peerConnectionEvents.d.ts +77 -1
  338. package/lib/webrtc/src/api/peerConnectionEvents.js +105 -1
  339. package/lib/webrtc/src/api/peerConnectionEvents.js.map +1 -1
  340. package/lib/webrtc/src/dataChannel.d.ts +10 -0
  341. package/lib/webrtc/src/dataChannel.js +24 -4
  342. package/lib/webrtc/src/dataChannel.js.map +1 -1
  343. package/lib/webrtc/src/helper.d.ts +8 -0
  344. package/lib/webrtc/src/helper.js +40 -4
  345. package/lib/webrtc/src/helper.js.map +1 -1
  346. package/lib/webrtc/src/media/codecCompatibility.d.ts +87 -1
  347. package/lib/webrtc/src/media/codecCompatibility.js +338 -12
  348. package/lib/webrtc/src/media/codecCompatibility.js.map +1 -1
  349. package/lib/webrtc/src/media/index.d.ts +10 -0
  350. package/lib/webrtc/src/media/index.js +70 -0
  351. package/lib/webrtc/src/media/index.js.map +1 -1
  352. package/lib/webrtc/src/media/receiver/nack.d.ts +43 -10
  353. package/lib/webrtc/src/media/receiver/nack.js +246 -88
  354. package/lib/webrtc/src/media/receiver/nack.js.map +1 -1
  355. package/lib/webrtc/src/media/receiver/receiverTwcc.d.ts +61 -1
  356. package/lib/webrtc/src/media/receiver/receiverTwcc.js +218 -63
  357. package/lib/webrtc/src/media/receiver/receiverTwcc.js.map +1 -1
  358. package/lib/webrtc/src/media/router.d.ts +241 -40
  359. package/lib/webrtc/src/media/router.js +676 -205
  360. package/lib/webrtc/src/media/router.js.map +1 -1
  361. package/lib/webrtc/src/media/routing/pendingRoutes.d.ts +26 -0
  362. package/lib/webrtc/src/media/routing/pendingRoutes.js +48 -0
  363. package/lib/webrtc/src/media/routing/pendingRoutes.js.map +1 -0
  364. package/lib/webrtc/src/media/routing/ridRouting.d.ts +37 -0
  365. package/lib/webrtc/src/media/routing/ridRouting.js +74 -0
  366. package/lib/webrtc/src/media/routing/ridRouting.js.map +1 -0
  367. package/lib/webrtc/src/media/routing/routeTable.d.ts +60 -0
  368. package/lib/webrtc/src/media/routing/routeTable.js +95 -0
  369. package/lib/webrtc/src/media/routing/routeTable.js.map +1 -0
  370. package/lib/webrtc/src/media/routing/rtcpRouting.d.ts +34 -0
  371. package/lib/webrtc/src/media/routing/rtcpRouting.js +165 -0
  372. package/lib/webrtc/src/media/routing/rtcpRouting.js.map +1 -0
  373. package/lib/webrtc/src/media/routing/unknownSsrc.d.ts +55 -0
  374. package/lib/webrtc/src/media/routing/unknownSsrc.js +117 -0
  375. package/lib/webrtc/src/media/routing/unknownSsrc.js.map +1 -0
  376. package/lib/webrtc/src/media/rtpReceiver.d.ts +252 -2
  377. package/lib/webrtc/src/media/rtpReceiver.js +833 -44
  378. package/lib/webrtc/src/media/rtpReceiver.js.map +1 -1
  379. package/lib/webrtc/src/media/rtpSender.d.ts +191 -70
  380. package/lib/webrtc/src/media/rtpSender.js +631 -448
  381. package/lib/webrtc/src/media/rtpSender.js.map +1 -1
  382. package/lib/webrtc/src/media/rtpTransceiver.d.ts +19 -3
  383. package/lib/webrtc/src/media/rtpTransceiver.js +74 -9
  384. package/lib/webrtc/src/media/rtpTransceiver.js.map +1 -1
  385. package/lib/webrtc/src/media/sender/bandwidthEstimator.d.ts +249 -0
  386. package/lib/webrtc/src/media/sender/bandwidthEstimator.js +144 -0
  387. package/lib/webrtc/src/media/sender/bandwidthEstimator.js.map +1 -0
  388. package/lib/webrtc/src/media/sender/createBandwidthEstimator.d.ts +20 -0
  389. package/lib/webrtc/src/media/sender/createBandwidthEstimator.js +26 -0
  390. package/lib/webrtc/src/media/sender/createBandwidthEstimator.js.map +1 -0
  391. package/lib/webrtc/src/media/sender/estimatorBinding.d.ts +70 -0
  392. package/lib/webrtc/src/media/sender/estimatorBinding.js +175 -0
  393. package/lib/webrtc/src/media/sender/estimatorBinding.js.map +1 -0
  394. package/lib/webrtc/src/media/sender/estimators/disabledBwe.d.ts +18 -0
  395. package/lib/webrtc/src/media/sender/estimators/disabledBwe.js +44 -0
  396. package/lib/webrtc/src/media/sender/estimators/disabledBwe.js.map +1 -0
  397. package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.d.ts +79 -0
  398. package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js +289 -0
  399. package/lib/webrtc/src/media/sender/estimators/gcc/acknowledgedBitrateEstimator.js.map +1 -0
  400. package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.d.ts +87 -0
  401. package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js +429 -0
  402. package/lib/webrtc/src/media/sender/estimators/gcc/aimdRateControl.js.map +1 -0
  403. package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.d.ts +21 -0
  404. package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js +84 -0
  405. package/lib/webrtc/src/media/sender/estimators/gcc/alrDetector.js.map +1 -0
  406. package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.d.ts +37 -0
  407. package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js +74 -0
  408. package/lib/webrtc/src/media/sender/estimators/gcc/bandwidthLimitedCause.js.map +1 -0
  409. package/lib/webrtc/src/media/sender/estimators/gcc/constants.d.ts +383 -0
  410. package/lib/webrtc/src/media/sender/estimators/gcc/constants.js +408 -0
  411. package/lib/webrtc/src/media/sender/estimators/gcc/constants.js.map +1 -0
  412. package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.d.ts +406 -0
  413. package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js +1391 -0
  414. package/lib/webrtc/src/media/sender/estimators/gcc/gccBwe.js.map +1 -0
  415. package/lib/webrtc/src/media/sender/estimators/gcc/index.d.ts +19 -0
  416. package/lib/webrtc/src/media/sender/estimators/gcc/index.js +75 -0
  417. package/lib/webrtc/src/media/sender/estimators/gcc/index.js.map +1 -0
  418. package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.d.ts +68 -0
  419. package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js +201 -0
  420. package/lib/webrtc/src/media/sender/estimators/gcc/interArrivalDelta.js.map +1 -0
  421. package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.d.ts +26 -0
  422. package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js +72 -0
  423. package/lib/webrtc/src/media/sender/estimators/gcc/intervalBudget.js.map +1 -0
  424. package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.d.ts +41 -0
  425. package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js +99 -0
  426. package/lib/webrtc/src/media/sender/estimators/gcc/linkCapacityEstimator.js.map +1 -0
  427. package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.d.ts +247 -0
  428. package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js +1042 -0
  429. package/lib/webrtc/src/media/sender/estimators/gcc/lossBasedBwe.js.map +1 -0
  430. package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.d.ts +26 -0
  431. package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js +132 -0
  432. package/lib/webrtc/src/media/sender/estimators/gcc/overuseDetector.js.map +1 -0
  433. package/lib/webrtc/src/media/sender/estimators/gcc/probeController.d.ts +305 -0
  434. package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js +1073 -0
  435. package/lib/webrtc/src/media/sender/estimators/gcc/probeController.js.map +1 -0
  436. package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.d.ts +60 -0
  437. package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js +151 -0
  438. package/lib/webrtc/src/media/sender/estimators/gcc/rttBasedBackoff.js.map +1 -0
  439. package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.d.ts +44 -0
  440. package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js +246 -0
  441. package/lib/webrtc/src/media/sender/estimators/gcc/trendlineEstimator.js.map +1 -0
  442. package/lib/webrtc/src/media/sender/estimators/index.d.ts +7 -0
  443. package/lib/webrtc/src/media/sender/estimators/index.js +19 -0
  444. package/lib/webrtc/src/media/sender/estimators/index.js.map +1 -0
  445. package/lib/webrtc/src/media/sender/estimators/lightweightBwe.d.ts +64 -0
  446. package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js +216 -0
  447. package/lib/webrtc/src/media/sender/estimators/lightweightBwe.js.map +1 -0
  448. package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.d.ts +117 -0
  449. package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js +250 -0
  450. package/lib/webrtc/src/media/sender/estimators/twccFeedbackAdapter.js.map +1 -0
  451. package/lib/webrtc/src/media/sender/outgoingQueue.d.ts +40 -0
  452. package/lib/webrtc/src/media/sender/outgoingQueue.js +153 -0
  453. package/lib/webrtc/src/media/sender/outgoingQueue.js.map +1 -0
  454. package/lib/webrtc/src/media/sender/padding.d.ts +45 -0
  455. package/lib/webrtc/src/media/sender/padding.js +134 -0
  456. package/lib/webrtc/src/media/sender/padding.js.map +1 -0
  457. package/lib/webrtc/src/media/sender/pendingRtp.d.ts +35 -0
  458. package/lib/webrtc/src/media/sender/pendingRtp.js +120 -0
  459. package/lib/webrtc/src/media/sender/pendingRtp.js.map +1 -0
  460. package/lib/webrtc/src/media/sender/rtpWire.d.ts +13 -0
  461. package/lib/webrtc/src/media/sender/rtpWire.js +38 -0
  462. package/lib/webrtc/src/media/sender/rtpWire.js.map +1 -0
  463. package/lib/webrtc/src/media/sender/sendPacer.d.ts +27 -0
  464. package/lib/webrtc/src/media/sender/sendPacer.js +110 -0
  465. package/lib/webrtc/src/media/sender/sendPacer.js.map +1 -0
  466. package/lib/webrtc/src/media/sender/senderBWE.d.ts +8 -33
  467. package/lib/webrtc/src/media/sender/senderBWE.js +5 -154
  468. package/lib/webrtc/src/media/sender/senderBWE.js.map +1 -1
  469. package/lib/webrtc/src/media/sender/senderReportHistory.d.ts +51 -0
  470. package/lib/webrtc/src/media/sender/senderReportHistory.js +111 -0
  471. package/lib/webrtc/src/media/sender/senderReportHistory.js.map +1 -0
  472. package/lib/webrtc/src/media/sender/senderStats.d.ts +101 -0
  473. package/lib/webrtc/src/media/sender/senderStats.js +317 -0
  474. package/lib/webrtc/src/media/sender/senderStats.js.map +1 -0
  475. package/lib/webrtc/src/media/track.d.ts +29 -2
  476. package/lib/webrtc/src/media/track.js +32 -5
  477. package/lib/webrtc/src/media/track.js.map +1 -1
  478. package/lib/webrtc/src/negotiation/bundleTopology.d.ts +1 -5
  479. package/lib/webrtc/src/negotiation/bundleTopology.js +15 -11
  480. package/lib/webrtc/src/negotiation/bundleTopology.js.map +1 -1
  481. package/lib/webrtc/src/negotiation/descriptionValidation.js +12 -6
  482. package/lib/webrtc/src/negotiation/descriptionValidation.js.map +1 -1
  483. package/lib/webrtc/src/negotiation/negotiationNeeded.js +2 -1
  484. package/lib/webrtc/src/negotiation/negotiationNeeded.js.map +1 -1
  485. package/lib/webrtc/src/negotiation/remoteCandidates.js +10 -5
  486. package/lib/webrtc/src/negotiation/remoteCandidates.js.map +1 -1
  487. package/lib/webrtc/src/negotiation/remoteMediaApplication.d.ts +24 -7
  488. package/lib/webrtc/src/negotiation/remoteMediaApplication.js +67 -27
  489. package/lib/webrtc/src/negotiation/remoteMediaApplication.js.map +1 -1
  490. package/lib/webrtc/src/negotiation/transceiverPairing.d.ts +1 -0
  491. package/lib/webrtc/src/negotiation/transceiverPairing.js +62 -0
  492. package/lib/webrtc/src/negotiation/transceiverPairing.js.map +1 -0
  493. package/lib/webrtc/src/negotiation/transportActivation.d.ts +8 -1
  494. package/lib/webrtc/src/negotiation/transportActivation.js +40 -8
  495. package/lib/webrtc/src/negotiation/transportActivation.js.map +1 -1
  496. package/lib/webrtc/src/negotiationTransaction.d.ts +43 -5
  497. package/lib/webrtc/src/negotiationTransaction.js +129 -13
  498. package/lib/webrtc/src/negotiationTransaction.js.map +1 -1
  499. package/lib/webrtc/src/nonstandard/dummyMedia.js +2 -1
  500. package/lib/webrtc/src/nonstandard/dummyMedia.js.map +1 -1
  501. package/lib/webrtc/src/nonstandard/navigator.js +4 -3
  502. package/lib/webrtc/src/nonstandard/navigator.js.map +1 -1
  503. package/lib/webrtc/src/nonstandard/recorder/index.d.ts +32 -8
  504. package/lib/webrtc/src/nonstandard/recorder/index.js +81 -20
  505. package/lib/webrtc/src/nonstandard/recorder/index.js.map +1 -1
  506. package/lib/webrtc/src/nonstandard/recorder/writer/index.d.ts +9 -7
  507. package/lib/webrtc/src/nonstandard/recorder/writer/index.js +2 -1
  508. package/lib/webrtc/src/nonstandard/recorder/writer/index.js.map +1 -1
  509. package/lib/webrtc/src/nonstandard/recorder/writer/ogg.d.ts +32 -0
  510. package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js +185 -0
  511. package/lib/webrtc/src/nonstandard/recorder/writer/ogg.js.map +1 -0
  512. package/lib/webrtc/src/nonstandard/recorder/writer/webm.js +8 -1
  513. package/lib/webrtc/src/nonstandard/recorder/writer/webm.js.map +1 -1
  514. package/lib/webrtc/src/nonstandard/userMedia.js +2 -1
  515. package/lib/webrtc/src/nonstandard/userMedia.js.map +1 -1
  516. package/lib/webrtc/src/peerConnection.d.ts +108 -6
  517. package/lib/webrtc/src/peerConnection.js +357 -36
  518. package/lib/webrtc/src/peerConnection.js.map +1 -1
  519. package/lib/webrtc/src/polyfill/globals.d.ts +2 -1
  520. package/lib/webrtc/src/polyfill/globals.js.map +1 -1
  521. package/lib/webrtc/src/polyfill/install.js +2 -0
  522. package/lib/webrtc/src/polyfill/install.js.map +1 -1
  523. package/lib/webrtc/src/polyfill/mediaDevices.js +2 -1
  524. package/lib/webrtc/src/polyfill/mediaDevices.js.map +1 -1
  525. package/lib/webrtc/src/sctpManager.d.ts +46 -14
  526. package/lib/webrtc/src/sctpManager.js +92 -25
  527. package/lib/webrtc/src/sctpManager.js.map +1 -1
  528. package/lib/webrtc/src/sdp.d.ts +69 -0
  529. package/lib/webrtc/src/sdp.js +151 -20
  530. package/lib/webrtc/src/sdp.js.map +1 -1
  531. package/lib/webrtc/src/sdpManager.d.ts +85 -4
  532. package/lib/webrtc/src/sdpManager.js +214 -14
  533. package/lib/webrtc/src/sdpManager.js.map +1 -1
  534. package/lib/webrtc/src/secureTransportManager.d.ts +89 -4
  535. package/lib/webrtc/src/secureTransportManager.js +184 -26
  536. package/lib/webrtc/src/secureTransportManager.js.map +1 -1
  537. package/lib/webrtc/src/transceiverManager.d.ts +82 -4
  538. package/lib/webrtc/src/transceiverManager.js +239 -41
  539. package/lib/webrtc/src/transceiverManager.js.map +1 -1
  540. package/lib/webrtc/src/transport/dtls.d.ts +147 -1
  541. package/lib/webrtc/src/transport/dtls.js +446 -50
  542. package/lib/webrtc/src/transport/dtls.js.map +1 -1
  543. package/lib/webrtc/src/transport/ice.d.ts +71 -90
  544. package/lib/webrtc/src/transport/ice.js +250 -42
  545. package/lib/webrtc/src/transport/ice.js.map +1 -1
  546. package/lib/webrtc/src/transport/sctp.d.ts +25 -0
  547. package/lib/webrtc/src/transport/sctp.js +153 -22
  548. package/lib/webrtc/src/transport/sctp.js.map +1 -1
  549. package/lib/webrtc/src/utils.d.ts +69 -3
  550. package/lib/webrtc/src/utils.js +105 -16
  551. package/lib/webrtc/src/utils.js.map +1 -1
  552. package/package.json +9 -6
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The constructor options of `PeerConfig` that choose between the behavior the
3
+ * specifications (W3C WebRTC, JSEP, the RTP RFCs) define and browsers
4
+ * implement, and werift's own behavior kept for existing applications. Each
5
+ * one takes two values:
6
+ * - `"standard"`: the specification / browser behavior, in every option.
7
+ * - a value naming werift's own behavior in that option:
8
+ * - `certificateScope: "process"`: one default DTLS certificate shared by
9
+ * the process (`"standard"`: one per `RTCPeerConnection`).
10
+ * - `mLineReuse: "aggressive"`: an accepted `inactive` m-line is also
11
+ * written with port 0, so its position is reused (`"standard"`: it keeps
12
+ * its port).
13
+ * - `transceiverPairing: "byKind"`: a remote offer's m-section takes any
14
+ * unassociated transceiver of its kind (`"standard"`: JSEP 5.10).
15
+ * - `keyFrameRequestRouting: "fallback"`: a PLI / FIR for an unknown SSRC
16
+ * falls back to the RTX owner or the only video sender of the transport
17
+ * it arrived on (`"standard"`: not delivered).
18
+ *
19
+ * Each option documents its default and whether `setConfiguration()` may
20
+ * change it. Any other value is a `TypeError`; the names used up to v0.27.0
21
+ * are still accepted (see `DeprecatedCompatibilityValues` in
22
+ * `api/peerConfig.ts`).
23
+ */
24
+ export declare const CompatibilityOptionValues: {
25
+ readonly certificateScope: readonly ["standard", "process"];
26
+ readonly mLineReuse: readonly ["standard", "aggressive"];
27
+ readonly transceiverPairing: readonly ["standard", "byKind"];
28
+ readonly keyFrameRequestRouting: readonly ["standard", "fallback"];
29
+ };
30
+ /** An option listed in {@link CompatibilityOptionValues}. */
31
+ export type CompatibilityOption = keyof typeof CompatibilityOptionValues;
32
+ /** The values of a compatibility option. */
33
+ export type CompatibilityOptionValue<K extends CompatibilityOption> = (typeof CompatibilityOptionValues)[K][number];
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CompatibilityOptionValues = void 0;
4
+ /**
5
+ * The constructor options of `PeerConfig` that choose between the behavior the
6
+ * specifications (W3C WebRTC, JSEP, the RTP RFCs) define and browsers
7
+ * implement, and werift's own behavior kept for existing applications. Each
8
+ * one takes two values:
9
+ * - `"standard"`: the specification / browser behavior, in every option.
10
+ * - a value naming werift's own behavior in that option:
11
+ * - `certificateScope: "process"`: one default DTLS certificate shared by
12
+ * the process (`"standard"`: one per `RTCPeerConnection`).
13
+ * - `mLineReuse: "aggressive"`: an accepted `inactive` m-line is also
14
+ * written with port 0, so its position is reused (`"standard"`: it keeps
15
+ * its port).
16
+ * - `transceiverPairing: "byKind"`: a remote offer's m-section takes any
17
+ * unassociated transceiver of its kind (`"standard"`: JSEP 5.10).
18
+ * - `keyFrameRequestRouting: "fallback"`: a PLI / FIR for an unknown SSRC
19
+ * falls back to the RTX owner or the only video sender of the transport
20
+ * it arrived on (`"standard"`: not delivered).
21
+ *
22
+ * Each option documents its default and whether `setConfiguration()` may
23
+ * change it. Any other value is a `TypeError`; the names used up to v0.27.0
24
+ * are still accepted (see `DeprecatedCompatibilityValues` in
25
+ * `api/peerConfig.ts`).
26
+ */
27
+ exports.CompatibilityOptionValues = {
28
+ certificateScope: ["standard", "process"],
29
+ mLineReuse: ["standard", "aggressive"],
30
+ transceiverPairing: ["standard", "byKind"],
31
+ keyFrameRequestRouting: ["standard", "fallback"],
32
+ };
33
+ //# sourceMappingURL=compatibilityOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibilityOptions.js","sourceRoot":"","sources":["../../../../src/api/compatibilityOptions.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACU,QAAA,yBAAyB,GAAG;IACvC,gBAAgB,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;IACzC,UAAU,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC;IACtC,kBAAkB,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC1C,sBAAsB,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;CACxC,CAAC","sourcesContent":["/**\n * The constructor options of `PeerConfig` that choose between the behavior the\n * specifications (W3C WebRTC, JSEP, the RTP RFCs) define and browsers\n * implement, and werift's own behavior kept for existing applications. Each\n * one takes two values:\n * - `\"standard\"`: the specification / browser behavior, in every option.\n * - a value naming werift's own behavior in that option:\n * - `certificateScope: \"process\"`: one default DTLS certificate shared by\n * the process (`\"standard\"`: one per `RTCPeerConnection`).\n * - `mLineReuse: \"aggressive\"`: an accepted `inactive` m-line is also\n * written with port 0, so its position is reused (`\"standard\"`: it keeps\n * its port).\n * - `transceiverPairing: \"byKind\"`: a remote offer's m-section takes any\n * unassociated transceiver of its kind (`\"standard\"`: JSEP 5.10).\n * - `keyFrameRequestRouting: \"fallback\"`: a PLI / FIR for an unknown SSRC\n * falls back to the RTX owner or the only video sender of the transport\n * it arrived on (`\"standard\"`: not delivered).\n *\n * Each option documents its default and whether `setConfiguration()` may\n * change it. Any other value is a `TypeError`; the names used up to v0.27.0\n * are still accepted (see `DeprecatedCompatibilityValues` in\n * `api/peerConfig.ts`).\n */\nexport const CompatibilityOptionValues = {\n certificateScope: [\"standard\", \"process\"],\n mLineReuse: [\"standard\", \"aggressive\"],\n transceiverPairing: [\"standard\", \"byKind\"],\n keyFrameRequestRouting: [\"standard\", \"fallback\"],\n} as const;\n\n/** An option listed in {@link CompatibilityOptionValues}. */\nexport type CompatibilityOption = keyof typeof CompatibilityOptionValues;\n\n/** The values of a compatibility option. */\nexport type CompatibilityOptionValue<K extends CompatibilityOption> =\n (typeof CompatibilityOptionValues)[K][number];\n"]}
@@ -1,11 +1,13 @@
1
1
  import type { Address, InterfaceAddresses, TlsConnectionOptions } from "../imports/common";
2
- import type { CandidatePair, Message, Protocol } from "../imports/ice";
2
+ import type { CandidatePair, Message, MessageIntegrityMode, Protocol } from "../imports/ice";
3
3
  import type { RTCRtpCodecParameters, RTCRtpHeaderExtensionParameters } from "../media/parameters";
4
- import { type KeyFrameRequestRouting } from "../media/router";
4
+ import type { KeyFrameRequestRouting } from "../media/router";
5
5
  import type { RTCRtpSenderOptions } from "../media/rtpSender";
6
+ import type { BandwidthEstimatorOption } from "../media/sender/createBandwidthEstimator";
6
7
  import type { BundlePolicy } from "../sdp";
7
- import type { MLineReuse } from "../sdpManager";
8
+ import { type BundleCandidates, type MLineReuse } from "../sdpManager";
8
9
  import type { DtlsKeys, RTCCertificate } from "../transport/dtls";
10
+ import { type CompatibilityOptionValue } from "./compatibilityOptions";
9
11
  export type DebugConfig = Partial<{
10
12
  /**% */
11
13
  inboundPacketLoss: number;
@@ -33,6 +35,13 @@ export interface PeerConfig {
33
35
  /** Advertise local ICE lite and operate in the controlled role. */
34
36
  iceLite: boolean;
35
37
  iceServers: RTCIceServer[];
38
+ /**
39
+ * Fall back to the built-in public STUN server (`stun.l.google.com:19302`)
40
+ * when `iceServers` contains no STUN URL (empty or TURN-only).
41
+ * Set to false to gather server-reflexive candidates only from the STUN
42
+ * servers given in `iceServers`. Defaults to true.
43
+ */
44
+ iceUseDefaultStunServer: boolean;
36
45
  /**Minimum port and Maximum port must not be the same value */
37
46
  icePortRange: [number, number] | undefined;
38
47
  /**
@@ -45,11 +54,29 @@ export interface PeerConfig {
45
54
  * VPN, ...). If the bind fails, the family has no UDP host candidate.
46
55
  * A family left unspecified while the other one is set gathers no
47
56
  * enumerated addresses (only its `iceAdditionalHostAddresses`).
57
+ *
58
+ * When unset, each enumerated interface address gets a UDP host socket
59
+ * bound to that address, so connectivity checks leave from the advertised
60
+ * candidate on multi-NIC hosts. An address whose bind fails is not
61
+ * advertised. VPN / tunnel interfaces (`tun`, `utun`, `ipsec`, `tap`) are
62
+ * gathered with a low priority and the default-route address with the
63
+ * highest: the source address of the route to the configured STUN / TURN
64
+ * server (without one, no address is preferred and nothing else is probed).
65
+ * With a STUN server, one more socket per family is bound to the
66
+ * wildcard address: it advertises no host candidate but maps the route the
67
+ * OS picks (server-reflexive candidate with `raddr 0.0.0.0`).
68
+ * `setLocalDescription()` waits only for that socket and the
69
+ * default-route one; the other interfaces' server-reflexive candidates
70
+ * trickle through `onicecandidate` before the end-of-candidates `null`.
71
+ * Set a family to `0.0.0.0` / `::` to gather its enumerated addresses over
72
+ * wildcard sockets instead.
48
73
  */
49
74
  iceInterfaceAddresses: InterfaceAddresses | undefined;
50
75
  /** Add additional host (local) addresses to use for candidate gathering.
51
- * Notably, you can include hosts that are normally excluded, such as loopback, tun interfaces, etc.
76
+ * Notably, you can include hosts that are normally excluded, such as loopback, vmnet / veth interfaces, etc.
52
77
  * For a family bound by `iceInterfaceAddresses`, addresses other than the bound one are ignored.
78
+ * An address assigned to a local interface is bound like an enumerated one; any other address
79
+ * (a 1:1 NAT public address, for example) is gathered over a wildcard socket.
53
80
  */
54
81
  iceAdditionalHostAddresses: string[] | undefined;
55
82
  iceUseIpv4: boolean;
@@ -59,7 +86,8 @@ export interface PeerConfig {
59
86
  iceTcpPassive: boolean;
60
87
  /**
61
88
  * Seconds to wait for server-reflexive candidates while gathering.
62
- * Defaults to 5 when undefined.
89
+ * Defaults to 5 when undefined. `setLocalDescription()` waits for it only
90
+ * on the wildcard and default-route sockets (see `iceInterfaceAddresses`).
63
91
  */
64
92
  iceStunGatherTimeout: number | undefined;
65
93
  /**
@@ -67,6 +95,35 @@ export interface PeerConfig {
67
95
  * Defaults to 8 when undefined.
68
96
  */
69
97
  iceTurnConnectTimeout: number | undefined;
98
+ /**
99
+ * werift extension. With `iceNomination: "regular"`: milliseconds the
100
+ * controlling ICE agent keeps checking before it nominates a candidate pair,
101
+ * so a higher-priority candidate trickled shortly after a lower-priority one
102
+ * succeeded can still be selected. Maps to `IceOptions.nominationDelayMs`:
103
+ * 300 when undefined, 0 nominates the first valid pair at once.
104
+ */
105
+ iceNominationDelayMs: number | undefined;
106
+ /**
107
+ * werift extension. How the controlling ICE agent nominates toward a full
108
+ * ICE peer (`IceOptions.nomination`). `"semi-aggressive"` (default when
109
+ * undefined, as Chrome): the first pair whose check succeeds is selected at
110
+ * once and a higher-priority pair that succeeds later replaces it.
111
+ * `"regular"`: RFC 8445 regular nomination, one nomination after
112
+ * `iceNominationDelayMs`.
113
+ */
114
+ iceNomination: "semi-aggressive" | "regular" | undefined;
115
+ /**
116
+ * werift extension. Enable ICE renomination
117
+ * (draft-thatcher-ice-renomination, as libwebrtc implements it): every
118
+ * description advertises `a=ice-options:trickle renomination`. When the
119
+ * remote description advertises `renomination` too, the controlling agent
120
+ * nominates with the NOMINATION STUN attribute and an increasing value, so
121
+ * a later, better pair reliably replaces the selection on both sides
122
+ * (`IceOptions.renomination`). Chrome advertises it only when its SDP is
123
+ * modified before `setLocalDescription`; as the controlled side it honours
124
+ * the attribute regardless. Defaults to false.
125
+ */
126
+ iceRenomination: boolean;
70
127
  turnTransport: "udp" | "tcp" | "tls" | undefined;
71
128
  turnTlsOptions: TlsConnectionOptions | undefined;
72
129
  /**
@@ -83,6 +140,27 @@ export interface PeerConfig {
83
140
  * Return `true` if a STUN response should be sent, false if it should be skipped. */
84
141
  iceFilterStunResponse: ((message: Message, addr: Address, protocol: Protocol) => boolean) | undefined;
85
142
  iceFilterCandidatePair: ((pair: CandidatePair) => boolean) | undefined;
143
+ /**
144
+ * Integrity attributes of the ICE connectivity checks and consent requests
145
+ * werift sends (RFC 8489 short-term credentials). Applies to ICE transports
146
+ * created after it is set.
147
+ * - `undefined` / `"sha1"` (default): MESSAGE-INTEGRITY only. Browsers
148
+ * (libwebrtc, Firefox) accept this.
149
+ * - `"sha256"`: MESSAGE-INTEGRITY-SHA256 only. Only for peers known to
150
+ * support it: a peer that does not know the attribute rejects the checks.
151
+ * - `"both"`: MESSAGE-INTEGRITY followed by MESSAGE-INTEGRITY-SHA256.
152
+ *
153
+ * Checks and responses from the peer are accepted with either algorithm,
154
+ * and responses are always signed with the algorithm of the request.
155
+ */
156
+ iceMessageIntegrity: MessageIntegrityMode | undefined;
157
+ /**
158
+ * Advertise the `ice2` ice-option (`a=ice-options:trickle ice2`, RFC 8445
159
+ * §10 / RFC 8839) to declare an RFC 8445 agent. Defaults to false
160
+ * (`a=ice-options:trickle`). It is only a declaration: werift runs the
161
+ * RFC 8445 procedures either way. Cannot be changed after construction.
162
+ */
163
+ iceOptionIce2: boolean;
86
164
  dtls: Partial<{
87
165
  keys: DtlsKeys;
88
166
  }>;
@@ -91,10 +169,28 @@ export interface PeerConfig {
91
169
  rtcpMuxPolicy: "require";
92
170
  iceCandidatePoolSize: number;
93
171
  certificates: RTCCertificate[];
172
+ /**
173
+ * Which default DTLS certificate is used when neither `certificates` nor `dtls.keys` is given
174
+ * (see {@link CompatibilityOptionValues}). Cannot be changed after construction.
175
+ * - `"process"` (default): one certificate shared by every RTCPeerConnection in the process,
176
+ * so their `a=fingerprint` values are identical.
177
+ * - `"standard"`: each RTCPeerConnection generates its own certificate, as browsers do.
178
+ * All DTLS transports of that connection share it.
179
+ *
180
+ * Also accepts the v0.27.0 name `"peerConnection"` (= `"standard"`).
181
+ */
182
+ certificateScope: CertificateScope;
94
183
  debug: DebugConfig;
95
184
  midSuffix: boolean;
96
185
  /** Advertised local SCTP max-message-size in SDP. Use 0 for unlimited. */
97
186
  maxMessageSize: number;
187
+ /**
188
+ * When true, padding-only RTP is omitted from onReceiveRtp and later media
189
+ * sequence numbers are compacted. Default false preserves wire RTP events.
190
+ */
191
+ filterProbePaddingOnReceiveRtp: boolean;
192
+ /** Send-side estimator used by each new sender; defaults to `"lightweight"`. */
193
+ bandwidthEstimator: BandwidthEstimatorOption;
98
194
  /** SCTP outbound packet MTU used for DATA chunk fragmentation. */
99
195
  sctp: {
100
196
  mtu: number;
@@ -105,20 +201,121 @@ export interface PeerConfig {
105
201
  */
106
202
  pendingRtp: NonNullable<RTCRtpSenderOptions["pendingRtp"]>;
107
203
  /**
108
- * How local SDP marks inactive / stopped m-lines. Cannot be changed after construction.
109
- * - `"compatible"` (default): an accepted `inactive` m-line keeps a non-zero port.
110
- * Only rejected (no common codec / remote port 0) or stopped m-lines use port 0,
111
- * and only those negotiated port 0 positions are reused by new transceivers.
112
- * - `"aggressive"`: legacy behavior. `inactive` m-lines are also written with port 0.
204
+ * How local SDP marks inactive / stopped m-lines (see {@link CompatibilityOptionValues}).
205
+ * Cannot be changed after construction.
206
+ * - `"standard"` (default): an accepted `inactive` m-line keeps a non-zero port, as JSEP
207
+ * and browsers do. Only rejected (no common codec / remote port 0) or stopped m-lines
208
+ * use port 0, and only those negotiated port 0 positions are reused by new transceivers.
209
+ * - `"aggressive"`: behavior before v0.25.0. `inactive` m-lines are also written with
210
+ * port 0, so the remote side treats them as rejected and their positions are reused.
211
+ *
212
+ * Also accepts the v0.27.0 name `"compatible"` (= `"standard"`).
113
213
  */
114
214
  mLineReuse: MLineReuse;
115
215
  /**
116
- * Where a PLI / FIR goes when no route has its target SSRC. See {@link KeyFrameRequestRouting}.
117
- * - `"compatible"` (default): the sender whose RTX SSRC it is, else the only video sender.
118
- * - `"strict"`: not delivered, as RFC 4585 / RFC 5104 define the target.
216
+ * How a remote offer's m-sections are paired with local transceivers that
217
+ * have no MID yet (see {@link CompatibilityOptionValues}). Cannot be changed
218
+ * after construction.
219
+ * - `"byKind"` (default): behavior up to v0.27.0. Any unassociated,
220
+ * non-stopped transceiver of the same kind is paired (the one at the same
221
+ * m-line index first), whatever created it. In glare (perfect negotiation)
222
+ * the remote offer can take over a transceiver created with
223
+ * `addTransceiver(kind, { direction: "sendonly" })` and its direction
224
+ * becomes `sendrecv`.
225
+ * - `"standard"`: RFC 8829 (JSEP) section 5.10, as browsers do. An
226
+ * m-section whose MID no transceiver has is associated only with an
227
+ * unassociated, non-stopped transceiver of the same kind that
228
+ * `addTrack()` created (or one a rollback promoted to that, JSEP 4.1.8.2),
229
+ * and only when the m-section is `sendrecv` or `recvonly`. A transceiver
230
+ * created by `addTransceiver()` (with or without a track, also after
231
+ * `replaceTrack()` or a later `addTrack()` reusing it) is never paired:
232
+ * the offer gets a new transceiver, and the local one keeps its direction
233
+ * and `mid === null` until a local offer negotiates it. Use it for the
234
+ * perfect negotiation pattern and for code written for browsers.
235
+ */
236
+ transceiverPairing: TransceiverPairing;
237
+ /**
238
+ * Where a PLI / FIR goes when no route has its target SSRC (see
239
+ * {@link CompatibilityOptionValues} and {@link KeyFrameRequestRouting}).
240
+ * `setConfiguration()` may change it.
241
+ * - `"fallback"` (default): the sender whose RTX SSRC it is, else the only video sender.
242
+ * - `"standard"`: not delivered, as RFC 4585 / RFC 5104 define the target.
243
+ *
244
+ * Also accepts the names up to v0.27.0: `"compatible"` (= `"fallback"`) and
245
+ * `"strict"` (= `"standard"`).
119
246
  */
120
247
  keyFrameRequestRouting: KeyFrameRequestRouting;
248
+ /**
249
+ * Which m-lines of a BUNDLE group carry the local ICE candidates.
250
+ * Cannot be changed after construction. See {@link BundleCandidates}.
251
+ * - `"legacy"` (default): every m-line repeats its transport's candidates and
252
+ * `a=end-of-candidates` (werift's earlier output).
253
+ * - `"compatible"`: as Chrome writes them, only the BUNDLE tag m-line carries
254
+ * them, so renegotiation with more m-lines no longer repeats the candidate list.
255
+ */
256
+ bundleCandidates: BundleCandidates;
257
+ /**
258
+ * Sets every compatibility option (`certificateScope`, `mLineReuse`,
259
+ * `transceiverPairing`, `keyFrameRequestRouting`, see
260
+ * {@link CompatibilityOptionValues}) to the specification / browser behavior
261
+ * at once. Cannot be changed after construction.
262
+ * - `undefined` (default): each option keeps its own default.
263
+ * - `"standard"`: every compatibility option not given in the same
264
+ * configuration is `"standard"`.
265
+ *
266
+ * An option given explicitly always takes precedence over `compatibility`:
267
+ * a value given in the same configuration (an old name included) is kept,
268
+ * and `setConfiguration()` treats the options as if `compatibility` were
269
+ * not set (`keyFrameRequestRouting` may change, the others cannot). An
270
+ * option given as `undefined` counts as not given.
271
+ *
272
+ * ```ts
273
+ * new RTCPeerConnection({ compatibility: "standard" });
274
+ * // certificateScope, mLineReuse, transceiverPairing and
275
+ * // keyFrameRequestRouting are all "standard"
276
+ * new RTCPeerConnection({ compatibility: "standard", certificateScope: "process" });
277
+ * // certificateScope is "process", the other three are "standard"
278
+ * ```
279
+ *
280
+ * It does not change `iceServers` / `iceUseDefaultStunServer`, which are not
281
+ * compatibility options.
282
+ */
283
+ compatibility: CompatibilityPreset | undefined;
121
284
  }
285
+ /** Which default DTLS certificate is used. See {@link PeerConfig.certificateScope}. */
286
+ export type CertificateScope = CompatibilityOptionValue<"certificateScope">;
287
+ export declare const CertificateScopeModes: readonly CertificateScope[];
288
+ /** How local SDP marks inactive / stopped m-lines. See {@link PeerConfig.mLineReuse}. */
289
+ export declare const MLineReuseModes: readonly MLineReuse[];
290
+ /** How a remote offer pairs m-sections with local transceivers. See {@link PeerConfig.transceiverPairing}. */
291
+ export type TransceiverPairing = CompatibilityOptionValue<"transceiverPairing">;
292
+ export declare const TransceiverPairingModes: readonly TransceiverPairing[];
293
+ /** The values of {@link PeerConfig.compatibility}. */
294
+ export type CompatibilityPreset = "standard";
295
+ export declare const CompatibilityPresets: readonly CompatibilityPreset[];
296
+ /**
297
+ * The values the compatibility options used up to v0.27.0 that are not
298
+ * values any more, and the value each one is read as. They are accepted on
299
+ * input only: `getConfiguration()` returns the current name.
300
+ */
301
+ export declare const DeprecatedCompatibilityValues: {
302
+ readonly certificateScope: {
303
+ readonly peerConnection: "standard";
304
+ };
305
+ readonly mLineReuse: {
306
+ readonly compatible: "standard";
307
+ };
308
+ readonly keyFrameRequestRouting: {
309
+ readonly compatible: "fallback";
310
+ readonly strict: "standard";
311
+ };
312
+ };
313
+ /** @deprecated Use `"standard"` (`"peerConnection"`). */
314
+ export type DeprecatedCertificateScope = keyof (typeof DeprecatedCompatibilityValues)["certificateScope"];
315
+ /** @deprecated Use `"standard"` (`"compatible"`). */
316
+ export type DeprecatedMLineReuse = keyof (typeof DeprecatedCompatibilityValues)["mLineReuse"];
317
+ /** @deprecated Use `"fallback"` (`"compatible"`) or `"standard"` (`"strict"`). */
318
+ export type DeprecatedKeyFrameRequestRouting = keyof (typeof DeprecatedCompatibilityValues)["keyFrameRequestRouting"];
122
319
  export declare const findCodecByMimeType: (codecs: RTCRtpCodecParameters[], target: RTCRtpCodecParameters) => RTCRtpCodecParameters | undefined;
123
320
  export type RTCIceServer = {
124
321
  urls: string | string[];
@@ -142,8 +339,14 @@ export interface RTCConfiguration {
142
339
  type RTCPeerConnectionRTCConfiguration = Omit<RTCConfiguration, "bundlePolicy"> & {
143
340
  bundlePolicy?: PeerConfig["bundlePolicy"] | RTCBundlePolicy;
144
341
  };
145
- export type RTCPeerConnectionConfig = Partial<Omit<PeerConfig, "bundlePolicy" | "rtcpMuxPolicy" | "iceCandidatePoolSize" | "certificates" | "sctp">> & RTCPeerConnectionRTCConfiguration & {
342
+ export type RTCPeerConnectionConfig = Partial<Omit<PeerConfig, "bundlePolicy" | "rtcpMuxPolicy" | "iceCandidatePoolSize" | "certificates" | "sctp" | "certificateScope" | "mLineReuse" | "keyFrameRequestRouting">> & RTCPeerConnectionRTCConfiguration & {
146
343
  sctp?: RTCSctpConfiguration;
344
+ /** See {@link PeerConfig.certificateScope}. */
345
+ certificateScope?: CertificateScope | DeprecatedCertificateScope;
346
+ /** See {@link PeerConfig.mLineReuse}. */
347
+ mLineReuse?: MLineReuse | DeprecatedMLineReuse;
348
+ /** See {@link PeerConfig.keyFrameRequestRouting}. */
349
+ keyFrameRequestRouting?: KeyFrameRequestRouting | DeprecatedKeyFrameRequestRouting;
147
350
  };
148
351
  export declare function generateDefaultPeerConfig(): PeerConfig;
149
352
  export declare const defaultPeerConfig: PeerConfig;
@@ -184,6 +387,13 @@ export declare function clonePeerConfiguration(config: PeerConfig): {
184
387
  iceTransportPolicy: "all" | "relay";
185
388
  /** Advertise local ICE lite and operate in the controlled role. */
186
389
  iceLite: boolean;
390
+ /**
391
+ * Fall back to the built-in public STUN server (`stun.l.google.com:19302`)
392
+ * when `iceServers` contains no STUN URL (empty or TURN-only).
393
+ * Set to false to gather server-reflexive candidates only from the STUN
394
+ * servers given in `iceServers`. Defaults to true.
395
+ */
396
+ iceUseDefaultStunServer: boolean;
187
397
  /**
188
398
  * Local addresses to bind the ICE UDP host sockets to, per family
189
399
  * (`udp4` / `udp6`).
@@ -194,6 +404,22 @@ export declare function clonePeerConfiguration(config: PeerConfig): {
194
404
  * VPN, ...). If the bind fails, the family has no UDP host candidate.
195
405
  * A family left unspecified while the other one is set gathers no
196
406
  * enumerated addresses (only its `iceAdditionalHostAddresses`).
407
+ *
408
+ * When unset, each enumerated interface address gets a UDP host socket
409
+ * bound to that address, so connectivity checks leave from the advertised
410
+ * candidate on multi-NIC hosts. An address whose bind fails is not
411
+ * advertised. VPN / tunnel interfaces (`tun`, `utun`, `ipsec`, `tap`) are
412
+ * gathered with a low priority and the default-route address with the
413
+ * highest: the source address of the route to the configured STUN / TURN
414
+ * server (without one, no address is preferred and nothing else is probed).
415
+ * With a STUN server, one more socket per family is bound to the
416
+ * wildcard address: it advertises no host candidate but maps the route the
417
+ * OS picks (server-reflexive candidate with `raddr 0.0.0.0`).
418
+ * `setLocalDescription()` waits only for that socket and the
419
+ * default-route one; the other interfaces' server-reflexive candidates
420
+ * trickle through `onicecandidate` before the end-of-candidates `null`.
421
+ * Set a family to `0.0.0.0` / `::` to gather its enumerated addresses over
422
+ * wildcard sockets instead.
197
423
  */
198
424
  iceInterfaceAddresses: InterfaceAddresses | undefined;
199
425
  iceUseIpv4: boolean;
@@ -203,7 +429,8 @@ export declare function clonePeerConfiguration(config: PeerConfig): {
203
429
  iceTcpPassive: boolean;
204
430
  /**
205
431
  * Seconds to wait for server-reflexive candidates while gathering.
206
- * Defaults to 5 when undefined.
432
+ * Defaults to 5 when undefined. `setLocalDescription()` waits for it only
433
+ * on the wildcard and default-route sockets (see `iceInterfaceAddresses`).
207
434
  */
208
435
  iceStunGatherTimeout: number | undefined;
209
436
  /**
@@ -211,6 +438,35 @@ export declare function clonePeerConfiguration(config: PeerConfig): {
211
438
  * Defaults to 8 when undefined.
212
439
  */
213
440
  iceTurnConnectTimeout: number | undefined;
441
+ /**
442
+ * werift extension. With `iceNomination: "regular"`: milliseconds the
443
+ * controlling ICE agent keeps checking before it nominates a candidate pair,
444
+ * so a higher-priority candidate trickled shortly after a lower-priority one
445
+ * succeeded can still be selected. Maps to `IceOptions.nominationDelayMs`:
446
+ * 300 when undefined, 0 nominates the first valid pair at once.
447
+ */
448
+ iceNominationDelayMs: number | undefined;
449
+ /**
450
+ * werift extension. How the controlling ICE agent nominates toward a full
451
+ * ICE peer (`IceOptions.nomination`). `"semi-aggressive"` (default when
452
+ * undefined, as Chrome): the first pair whose check succeeds is selected at
453
+ * once and a higher-priority pair that succeeds later replaces it.
454
+ * `"regular"`: RFC 8445 regular nomination, one nomination after
455
+ * `iceNominationDelayMs`.
456
+ */
457
+ iceNomination: "semi-aggressive" | "regular" | undefined;
458
+ /**
459
+ * werift extension. Enable ICE renomination
460
+ * (draft-thatcher-ice-renomination, as libwebrtc implements it): every
461
+ * description advertises `a=ice-options:trickle renomination`. When the
462
+ * remote description advertises `renomination` too, the controlling agent
463
+ * nominates with the NOMINATION STUN attribute and an increasing value, so
464
+ * a later, better pair reliably replaces the selection on both sides
465
+ * (`IceOptions.renomination`). Chrome advertises it only when its SDP is
466
+ * modified before `setLocalDescription`; as the controlled side it honours
467
+ * the attribute regardless. Defaults to false.
468
+ */
469
+ iceRenomination: boolean;
214
470
  turnTransport: "udp" | "tcp" | "tls" | undefined;
215
471
  turnTlsOptions: TlsConnectionOptions | undefined;
216
472
  /**
@@ -227,33 +483,134 @@ export declare function clonePeerConfiguration(config: PeerConfig): {
227
483
  * Return `true` if a STUN response should be sent, false if it should be skipped. */
228
484
  iceFilterStunResponse: ((message: Message, addr: Address, protocol: Protocol) => boolean) | undefined;
229
485
  iceFilterCandidatePair: ((pair: CandidatePair) => boolean) | undefined;
486
+ /**
487
+ * Integrity attributes of the ICE connectivity checks and consent requests
488
+ * werift sends (RFC 8489 short-term credentials). Applies to ICE transports
489
+ * created after it is set.
490
+ * - `undefined` / `"sha1"` (default): MESSAGE-INTEGRITY only. Browsers
491
+ * (libwebrtc, Firefox) accept this.
492
+ * - `"sha256"`: MESSAGE-INTEGRITY-SHA256 only. Only for peers known to
493
+ * support it: a peer that does not know the attribute rejects the checks.
494
+ * - `"both"`: MESSAGE-INTEGRITY followed by MESSAGE-INTEGRITY-SHA256.
495
+ *
496
+ * Checks and responses from the peer are accepted with either algorithm,
497
+ * and responses are always signed with the algorithm of the request.
498
+ */
499
+ iceMessageIntegrity: MessageIntegrityMode | undefined;
500
+ /**
501
+ * Advertise the `ice2` ice-option (`a=ice-options:trickle ice2`, RFC 8445
502
+ * §10 / RFC 8839) to declare an RFC 8445 agent. Defaults to false
503
+ * (`a=ice-options:trickle`). It is only a declaration: werift runs the
504
+ * RFC 8445 procedures either way. Cannot be changed after construction.
505
+ */
506
+ iceOptionIce2: boolean;
230
507
  icePasswordPrefix: string | undefined;
231
508
  bundlePolicy: BundlePolicy;
232
509
  rtcpMuxPolicy: "require";
233
510
  iceCandidatePoolSize: number;
511
+ /**
512
+ * Which default DTLS certificate is used when neither `certificates` nor `dtls.keys` is given
513
+ * (see {@link CompatibilityOptionValues}). Cannot be changed after construction.
514
+ * - `"process"` (default): one certificate shared by every RTCPeerConnection in the process,
515
+ * so their `a=fingerprint` values are identical.
516
+ * - `"standard"`: each RTCPeerConnection generates its own certificate, as browsers do.
517
+ * All DTLS transports of that connection share it.
518
+ *
519
+ * Also accepts the v0.27.0 name `"peerConnection"` (= `"standard"`).
520
+ */
521
+ certificateScope: CertificateScope;
234
522
  midSuffix: boolean;
235
523
  /** Advertised local SCTP max-message-size in SDP. Use 0 for unlimited. */
236
524
  maxMessageSize: number;
237
525
  /**
238
- * How local SDP marks inactive / stopped m-lines. Cannot be changed after construction.
239
- * - `"compatible"` (default): an accepted `inactive` m-line keeps a non-zero port.
240
- * Only rejected (no common codec / remote port 0) or stopped m-lines use port 0,
241
- * and only those negotiated port 0 positions are reused by new transceivers.
242
- * - `"aggressive"`: legacy behavior. `inactive` m-lines are also written with port 0.
526
+ * When true, padding-only RTP is omitted from onReceiveRtp and later media
527
+ * sequence numbers are compacted. Default false preserves wire RTP events.
528
+ */
529
+ filterProbePaddingOnReceiveRtp: boolean;
530
+ /** Send-side estimator used by each new sender; defaults to `"lightweight"`. */
531
+ bandwidthEstimator: BandwidthEstimatorOption;
532
+ /**
533
+ * How local SDP marks inactive / stopped m-lines (see {@link CompatibilityOptionValues}).
534
+ * Cannot be changed after construction.
535
+ * - `"standard"` (default): an accepted `inactive` m-line keeps a non-zero port, as JSEP
536
+ * and browsers do. Only rejected (no common codec / remote port 0) or stopped m-lines
537
+ * use port 0, and only those negotiated port 0 positions are reused by new transceivers.
538
+ * - `"aggressive"`: behavior before v0.25.0. `inactive` m-lines are also written with
539
+ * port 0, so the remote side treats them as rejected and their positions are reused.
540
+ *
541
+ * Also accepts the v0.27.0 name `"compatible"` (= `"standard"`).
243
542
  */
244
543
  mLineReuse: MLineReuse;
245
544
  /**
246
- * Where a PLI / FIR goes when no route has its target SSRC. See {@link KeyFrameRequestRouting}.
247
- * - `"compatible"` (default): the sender whose RTX SSRC it is, else the only video sender.
248
- * - `"strict"`: not delivered, as RFC 4585 / RFC 5104 define the target.
545
+ * How a remote offer's m-sections are paired with local transceivers that
546
+ * have no MID yet (see {@link CompatibilityOptionValues}). Cannot be changed
547
+ * after construction.
548
+ * - `"byKind"` (default): behavior up to v0.27.0. Any unassociated,
549
+ * non-stopped transceiver of the same kind is paired (the one at the same
550
+ * m-line index first), whatever created it. In glare (perfect negotiation)
551
+ * the remote offer can take over a transceiver created with
552
+ * `addTransceiver(kind, { direction: "sendonly" })` and its direction
553
+ * becomes `sendrecv`.
554
+ * - `"standard"`: RFC 8829 (JSEP) section 5.10, as browsers do. An
555
+ * m-section whose MID no transceiver has is associated only with an
556
+ * unassociated, non-stopped transceiver of the same kind that
557
+ * `addTrack()` created (or one a rollback promoted to that, JSEP 4.1.8.2),
558
+ * and only when the m-section is `sendrecv` or `recvonly`. A transceiver
559
+ * created by `addTransceiver()` (with or without a track, also after
560
+ * `replaceTrack()` or a later `addTrack()` reusing it) is never paired:
561
+ * the offer gets a new transceiver, and the local one keeps its direction
562
+ * and `mid === null` until a local offer negotiates it. Use it for the
563
+ * perfect negotiation pattern and for code written for browsers.
564
+ */
565
+ transceiverPairing: TransceiverPairing;
566
+ /**
567
+ * Where a PLI / FIR goes when no route has its target SSRC (see
568
+ * {@link CompatibilityOptionValues} and {@link KeyFrameRequestRouting}).
569
+ * `setConfiguration()` may change it.
570
+ * - `"fallback"` (default): the sender whose RTX SSRC it is, else the only video sender.
571
+ * - `"standard"`: not delivered, as RFC 4585 / RFC 5104 define the target.
572
+ *
573
+ * Also accepts the names up to v0.27.0: `"compatible"` (= `"fallback"`) and
574
+ * `"strict"` (= `"standard"`).
249
575
  */
250
576
  keyFrameRequestRouting: KeyFrameRequestRouting;
577
+ /**
578
+ * Which m-lines of a BUNDLE group carry the local ICE candidates.
579
+ * Cannot be changed after construction. See {@link BundleCandidates}.
580
+ * - `"legacy"` (default): every m-line repeats its transport's candidates and
581
+ * `a=end-of-candidates` (werift's earlier output).
582
+ * - `"compatible"`: as Chrome writes them, only the BUNDLE tag m-line carries
583
+ * them, so renegotiation with more m-lines no longer repeats the candidate list.
584
+ */
585
+ bundleCandidates: BundleCandidates;
586
+ /**
587
+ * Sets every compatibility option (`certificateScope`, `mLineReuse`,
588
+ * `transceiverPairing`, `keyFrameRequestRouting`, see
589
+ * {@link CompatibilityOptionValues}) to the specification / browser behavior
590
+ * at once. Cannot be changed after construction.
591
+ * - `undefined` (default): each option keeps its own default.
592
+ * - `"standard"`: every compatibility option not given in the same
593
+ * configuration is `"standard"`.
594
+ *
595
+ * An option given explicitly always takes precedence over `compatibility`:
596
+ * a value given in the same configuration (an old name included) is kept,
597
+ * and `setConfiguration()` treats the options as if `compatibility` were
598
+ * not set (`keyFrameRequestRouting` may change, the others cannot). An
599
+ * option given as `undefined` counts as not given.
600
+ *
601
+ * ```ts
602
+ * new RTCPeerConnection({ compatibility: "standard" });
603
+ * // certificateScope, mLineReuse, transceiverPairing and
604
+ * // keyFrameRequestRouting are all "standard"
605
+ * new RTCPeerConnection({ compatibility: "standard", certificateScope: "process" });
606
+ * // certificateScope is "process", the other three are "standard"
607
+ * ```
608
+ *
609
+ * It does not change `iceServers` / `iceUseDefaultStunServer`, which are not
610
+ * compatibility options.
611
+ */
612
+ compatibility: CompatibilityPreset | undefined;
251
613
  };
252
- /**
253
- * `setConfiguration`: validate `input` against the current `config`, then
254
- * merge it in place. Returns the normalized input; side effects on live
255
- * transports (SCTP limits, ICE servers) stay with the caller.
256
- */
257
614
  export declare function mergePeerConfiguration(config: PeerConfig, input: RTCPeerConnectionConfig, { isReconfiguration, hasLocalDescription, hasSctpTransport, }: {
258
615
  isReconfiguration: boolean;
259
616
  hasLocalDescription: boolean;