Skip to content

Commit 70fc5b4

Browse files
authored
peer_connection: Add restart_ice() (webrtc-rs#632)
1 parent e779c24 commit 70fc5b4

File tree

1 file changed

+8
-0
lines changed
  • webrtc/src/peer_connection

1 file changed

+8
-0
lines changed

webrtc/src/peer_connection/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,14 @@ impl RTCPeerConnection {
651651
}
652652
}
653653

654+
/// restart_ice restart ICE and triggers negotiation needed
655+
/// <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-restartice>
656+
pub async fn restart_ice(&self) -> Result<()> {
657+
self.internal.ice_transport.restart().await?;
658+
self.internal.trigger_negotiation_needed().await;
659+
Ok(())
660+
}
661+
654662
// set_configuration updates the configuration of this PeerConnection object.
655663
pub async fn set_configuration(&self, configuration: RTCConfiguration) -> Result<()> {
656664
// https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-setconfiguration (step #2)

0 commit comments

Comments
 (0)