WEBRTCREAL TIME COMMUNICATION EN ELNAVEGADOR.
View Slide
David Vílchez@dvilchezBIENVENIDOSAgile galicia
WEBRTCQUÉ ES?
WEBRTC
WEBRTCGETUSERMEDIA (MEDIASTREAM)var constraints = {audio: true, video: true};navigator.getUserMedia(constraints, function(stream) {video.src = window.URL.createObjectURL(stream);}, errorCallback);
WEBRTCPEERCONNECTIONalice = new RTCPeerConnection(null, null)alice.add(stream)alice.createOffer().then(offer => {return alice.setLocalDescription(offer).then( () => {sendOffer(“bob”, offer);});}).catch(errorHandler);
WEBRTCPEERCONNECTIONbob = new RTCPeerConnection(null, null)bob.setRemoteDescriptor(offer).then(() => {bob.createAnswer().then((answer) => {return bob.setLocalDescription(answer).then(() => {sendAnswer(“alice”, answer);});}).catch(errorHandler);
WEBRTCSENDOFFER(….. )SENDANSWER(….. )
WEBRTCSIGNALING
WEBRTCP2P CON SERVIDORES
WEBRTCNO USAR▸ Video and audio streaming▸ Comunicación asincrona
GRACIAS