@@ -142,12 +142,21 @@ export type InitialBroadcastProps = {
142142 video : boolean | Omit < MediaTrackConstraints , "deviceId" > ;
143143
144144 /**
145+ * @deprecated in favor of `iceServers`
146+ *
145147 * Whether to disable ICE gathering.
146148 *
147149 * Set to true to disable ICE gathering. This is useful for testing purposes.
148150 */
149151 noIceGathering ?: boolean ;
150152
153+ /**
154+ * The ICE servers to use.
155+ *
156+ * If not provided, the default ICE servers will be used.
157+ */
158+ iceServers ?: RTCIceServer | RTCIceServer [ ] ;
159+
151160 /**
152161 * Whether the video stream should be mirrored (horizontally flipped).
153162 *
@@ -335,6 +344,7 @@ export const createBroadcastStore = ({
335344 ingestUrl : ingestUrl ?? null ,
336345 video : initialProps ?. video ?? true ,
337346 noIceGathering : initialProps ?. noIceGathering ?? false ,
347+ iceServers : initialProps ?. iceServers ,
338348 mirrored : initialProps ?. mirrored ?? false ,
339349 } ,
340350
@@ -475,7 +485,7 @@ export const createBroadcastStore = ({
475485 requestedVideoInputDeviceId :
476486 deviceIds ?. videoinput === "screen"
477487 ? "default"
478- : ( deviceIds ?. videoinput ?? "default" ) ,
488+ : deviceIds ?. videoinput ?? "default" ,
479489 } ,
480490 } ) ) ,
481491
@@ -488,10 +498,10 @@ export const createBroadcastStore = ({
488498 requestedVideoInputDeviceId : deviceId ,
489499 }
490500 : type === "audioinput"
491- ? {
492- requestedAudioInputDeviceId : deviceId ,
493- }
494- : { } ) ,
501+ ? {
502+ requestedAudioInputDeviceId : deviceId ,
503+ }
504+ : { } ) ,
495505 } ,
496506 } ) ) ,
497507
@@ -760,8 +770,9 @@ const addEffectsToStore = (
760770 __controls . requestedForceRenegotiateLastTime ,
761771 mounted,
762772 noIceGathering : __initialProps . noIceGathering ,
773+ iceServers : __initialProps . iceServers ,
763774 } ) ,
764- async ( { enabled, ingestUrl, noIceGathering } ) => {
775+ async ( { enabled, ingestUrl, noIceGathering, iceServers } ) => {
765776 await cleanupWhip ?.( ) ;
766777
767778 if ( ! enabled ) {
@@ -803,6 +814,7 @@ const addEffectsToStore = (
803814 } ,
804815 sdpTimeout : null ,
805816 noIceGathering,
817+ iceServers,
806818 } ) ;
807819
808820 cleanupWhip = ( ) => {
@@ -891,10 +903,10 @@ const addEffectsToStore = (
891903 } ,
892904 }
893905 : audio
894- ? {
895- ...( audioConstraints ? audioConstraints : { } ) ,
896- }
897- : false ,
906+ ? {
907+ ...( audioConstraints ? audioConstraints : { } ) ,
908+ }
909+ : false ,
898910 video :
899911 video &&
900912 requestedVideoDeviceId &&
@@ -907,11 +919,11 @@ const addEffectsToStore = (
907919 ...( mirrored ? { facingMode : "user" } : { } ) ,
908920 }
909921 : video
910- ? {
911- ...( videoConstraints ? videoConstraints : { } ) ,
912- ...( mirrored ? { facingMode : "user" } : { } ) ,
913- }
914- : false ,
922+ ? {
923+ ...( videoConstraints ? videoConstraints : { } ) ,
924+ ...( mirrored ? { facingMode : "user" } : { } ) ,
925+ }
926+ : false ,
915927 } ) ) ;
916928
917929 if ( stream ) {
@@ -1133,8 +1145,8 @@ const addEffectsToStore = (
11331145 device . kind === "audioinput"
11341146 ? "Audio Source"
11351147 : device . kind === "audiooutput"
1136- ? "Audio Output"
1137- : "Video Source"
1148+ ? "Audio Output"
1149+ : "Video Source"
11381150 } ${ i + 1 } (${
11391151 device . deviceId === "default"
11401152 ? "default"
0 commit comments