RTCPeerConnection.restartIce()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2021ë 4ì.
WebRTC APIì RTCPeerConnection ì¸í°íì´ì¤ììë restartIce() ë©ìë를 ì ê³µí´ì ì°ê²°ì ì쪽ìì ICE candidateì ì¬ìì§ ìì²ì ê°ë¨íê² í ì ìê² ë§ë¤ì´ì¤ëë¤.
restartIce()ê° ë°íì í ë¤ìë, offerê° ìê·¸ëë§ ë©ì»¤ëì¦ì íµí´ ì ë¬ëê³ , ì격 í¼ì´ê° ë°ì offer를 descriptionì¼ë¡ ì¤ì ì íê² ë©ëë¤.ì´ ê³¼ì ì´ ìë£ëë©´, createOffer()ì ëí ë¤ì í¸ì¶ë¡ ë°íë offerê° ë¡ì»¬ í¼ì´ (ë¡ì»¬ë¡ ì¤ì ì´ ë ê²½ì°)ì ì격 í¼ì´ìì ICE ì¬ììì ë°ììí¤ëë¡ ì¤ì ë©ëë¤.
restartIce()ë RTCPeerConnectionì ëí negotiationneeded ì´ë²¤í¸ë¥¼ ë°ììì¼ì ì´í리ì¼ì´ì
ì´ ì í¸ ì±ëì íµí´ì íìì ìííëë¡ í©ëë¤.
ë§ì½ íìì´ ë¡¤ë°± íìì´ë ìì ë°ì offerê° ì´ë¯¸ íì ì¤ì¼ë¡ ì¸í´ ì¤í¨íê²ëë©´, RTCPeerConnectionê° ICE ì¬ìì ìì²ì íë¤ë ê²ì ìëì¼ë¡ 기ìµí©ëë¤. ë¤ìë²ì ì°ê²°ì signalingStateê° stableë¡ ë°ëê²ëë©´, ì°ê²° ì¸í°íì´ì¤ê° negotiationneeded ì´ë²¤í¸ë¥¼ ë°ììíµëë¤. ì´ ê³¼ì ì ICE ì¬ìì ê³¼ì ì´ ì¨ì í ìë£ë ëê¹ì§ ë°ë³µë©ëë¤.
Syntax
RTCPeerConnection.restartIce();
매ê°ë³ì
ìì.
ë°í ê°
undefined.
createOffer()를 ì¬ì©í´ì ë§ë¤ì´ì§ ë¤ì offerê° ì í¸ ë©ì»¤ëì¦ì íµí´ ì격 ì ì ìê² ì ë¬ì´ ëë©´, ICE ì¬ììì ììíëë¡ ë§ëëë¤. ICE를 ì¬ììíê²ëë©´ 기본ì ì¼ë¡ ICEê° ì´ê¸°íëê³ , ìë¡ì´ ì¦ëª
ì를 ì¬ì©í´ì ì ê· candidate를 ìì±í©ëë¤. 기존ì ì¡´ì¬íë 미ëì´ ì ì¡/ìì ì ì´ ê³¼ì ëììë ë°©í´ë°ì§ ììµëë¤.
ICE ì¬ììì ìëì리를 ì¢ ë ìì¸í ìê³ ì¶ë¤ë©´, ICE restartì RFC 5245, ì¹ì 9.1.1.1: ICE specification를 ì°¸ê³ íììì¤.
ìì
ìëì ìì ë iceconnectionstatechange ì´ë²¤í¸ì ëí í¸ë¤ë¬ì
ëë¤. ì´ í¸ë¤ë¬ë ICE를 ì¬ììíì¬ failed ìíë¡ì ì íì ê´ë¦¬í©ëë¤.
pc.addEventListener("iceconnectionstatechange", (event) => {
if (pc.iceConnectionState === "failed") {
/* possibly reconfigure the connection in some way here */
/* then request ICE restart */
pc.restartIce();
}
});
ìì ì½ë를 ì¬ì©íì¬ ICE íì ì¤ failed ìíë¡ ì íëë©´ ì½ëê° ì ìì ì¼ë¡ ì¬íì ëì´ì¼ í기 ë문ì negotiationneeded ì´ë²¤í¸ê° ë°ìí©ëë¤. ê·¸ë¬ë, restartIce()를 í¸ì¶í기 ë문ì negotiationneededì ëí í¸ë¤ë¬ìì ë°ìíë createOffer() í¸ì¶ì ì¼ë°ì ì¼ë¡ ìíëë ì¬íìì´ ìëë¼ ICE ì¬ììì ë°ììíµëë¤.
ëª ì¸ì
| Specification |
|---|
| WebRTC: Real-Time Communication in Browsers > # dom-rtcpeerconnection-restartice > |