From 980fe00a74a9ad013b945755415ace2e5429c3c2 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Wed, 27 Oct 2021 02:31:24 +0300 Subject: [RU] Remove notranslate (#2874) --- files/ru/web/api/rtcpeerconnection/icecandidate_event/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'files/ru/web/api/rtcpeerconnection/icecandidate_event') diff --git a/files/ru/web/api/rtcpeerconnection/icecandidate_event/index.html b/files/ru/web/api/rtcpeerconnection/icecandidate_event/index.html index 4cf9d46d46..781f299272 100644 --- a/files/ru/web/api/rtcpeerconnection/icecandidate_event/index.html +++ b/files/ru/web/api/rtcpeerconnection/icecandidate_event/index.html @@ -36,7 +36,7 @@ translation_of: Web/API/RTCPeerConnection/icecandidate_event

В основном события icecandidate происходят, чтобы указать, что новый кандидат был построен (gathered). Этого кандидата нужно доставить удалённому клиенту (remote peer) через канал сигнализации (signaling channel), которым управляет ваш код.

-
rtcPeerConnection.onicecandidate = (event) => {
+
rtcPeerConnection.onicecandidate = (event) => {
   if (event.candidate) {
     sendCandidateToRemotePeer(event.candidate)
   } else {
@@ -63,7 +63,7 @@ translation_of: Web/API/RTCPeerConnection/icecandidate_event
 
 

If you need to perform any special actions when there are no further candidates expected, you're much better off watching the ICE gathering state by watching for {{domxref("RTCPeerConnection.icegatheringstatechange_event", "icegatheringstatechange")}} events:

-
pc.addEventListener("icegatheringstatechange", ev => {
+
pc.addEventListener("icegatheringstatechange", ev => {
   switch(pc.iceGatheringState) {
     case "new":
       /* gathering is either just starting or has been reset */
@@ -88,7 +88,7 @@ translation_of: Web/API/RTCPeerConnection/icecandidate_event
 
 

First, an example using {{domxref("EventTarget.addEventListener", "addEventListener()")}}:

-
pc.addEventListener("icecandidate", ev => {
+
pc.addEventListener("icecandidate", ev => {
   if (ev.candidate) {
     sendMessage({
       type: "new-ice-candidate",
@@ -100,7 +100,7 @@ translation_of: Web/API/RTCPeerConnection/icecandidate_event
 
 

You can also set the {{domxref("RTCPeerConnection.onicecandidate", "onicecandidate")}} event handler property directly:

-
pc.onicecandidate = ev => {
+
pc.onicecandidate = ev => {
   if (ev.candidate) {
     sendMessage({
       type: "new-ice-candidate",
-- 
cgit v1.2.3-54-g00ecf