본문 바로가기

Computer science/WebRTC

(7)
WebRTC - multiconnection There are roughly three ways to connect multi users in WebRTC 1. Full Mesh Network 2. Small world network 3. Hierarchical Network With full mesh network, a peer are connected to all other peers. Thus, it should be looking like this. The adventages of using this network is a peer is able to access all other peers. That means, one can see six videos(including itself) at the same time. On the other..
WebRTC 참고 자료 모음 1. html5rocs: https://www.html5rocks.com/ko/tutorials/webrtc/basics/ Getting Started with WebRTC - HTML5 Rocks Plugin-free, realtime communication of video, audio and data using WebRTC. www.html5rocks.com 1-1. stun, turn server: https://www.html5rocks.com/en/tutorials/webrtc/infrastructure/ WebRTC in the real world: STUN, TURN and signaling - HTML5 Rocks Build the back-end services you need to r..
webRTC 용어 정리 Interactive Connectivity Establishment(ICE): 웹 브라우저가 다른 동료들과 연결할 수 있게 하는 프레임 워크 Peer A와 Peer B를 직접적으로 연결할 수 없는 다양한 이유가 있다. 1. 연결을 생성하지 못하게 막는 방화벽을 우회해야 한다. 2. public ip 주소를 갖고 있지 않은 장치에게 고유한 주소(unique address)를 배정해야 한다. 3. 라우터가 직접적으로 동료들과 연결하는 것을 허락하지 않으면 서버를 거쳐 데이터를 주고 받아야 한다. ICE는 STUN 서버나 TURN서버 이용한다. Session Traversal Utilities for NAT(STUN): public address를 발견하고 라우터에 걸려 있는 제약 사항을 알아내는 프로토콜이..
WebRTC - other parts Remote streams RTCPeerConnection이 다른 동료와 연결될 때, 비디오나 오디오를 송출하는 것이 가능해 진다. 바로 이 때가 getUserMedia()로 받은 송출 흐름(stream)을 RTCPeerConnection에 연결할 때이다. 다른 동료에게 media를 전송할 때, 최소 한 개 이상의 media track으로 구성된 media stream을 개별적으로 RTCPeerConnection에 추가한다. const localStream = await getUserMedia({vide: true, audio: true}); const peerConnection = new RTCPeerConnection(iceConfig); localStream.getTracks().forEach(tr..
WebRTC - peer connections Peer connections는 WebRTC의 일부분으로 p2p로 두 개의 다른 컴퓨터에 있는 애플리케이션을 연결하는 것을 관장한다. 두 유저 사이의 연결은 비디오, 오디오 혹은 arbitrary binary data(클라이언트가 RTCDataChannel API를 지원한다면)가 될 수 있다. 두 명의 유저가 연결하는 방법을 알기 위해서, 두 클라이언트는 ICE Server 구성을 필요로 한다. 이 서버는 STUN이나 TURN 서버가 될 수 있고, 이들 서버의 역할은 ICE candidates를 각각의 클라이언트에게 제공하는 것이다. ICE candidates를 전송하는 것을 보통 signaling이라고 부른다. Signaling WebRTC는 ICE(Internet Connectivity Establi..
WebRTC - Media capture and constraints WebRTC의 media 파트는 하드웨어인 카메라와 마이크에 접근해서 비디오와 음성을 포착하는(capturing) 역할을 담당한다. 이 뿐만 아니라, media stream이 작동하는 방법과 screen capturing 같은 display media도 담당한다. Medi devices Navigator.mediaDevices 오브젝트를 이용하여 모든 카메라와 마이크를 관리할 수 있다. media 장치(카메라, 마이크)는 언제든 연결되고, 연결 해제될 수 있기 때문에 잘 관리해야 한다. Constraints media 장치에 접근할 때는 가장 디테일한 제약 조건을 제공하는 것이 좋다. 간단한 제약 조건을 사용하면 쉽게 기본 카메라와 마이크에 접근할 수 있지만, 최적의 media stream을 전달하지는 ..
WebRTC - Media devices WebRTC란 무엇인가? WebRTC는 Web real-time communication의 약자이다. WebRTC를 사용하여 앱에 real-time communication 기능을 추가할 수 있다. WebRTC는 비디오, 음성 외에도 다양한 데이터를 p2p로 전송한다. 모든 현대 브라우저에 적용 가능하며, 대부분의 플랫폼에서 네이티브 클라이언트로 작동한다. open web standard로 구현되었고 Javascript API처럼 작동한다. WebRTC APIs WebRTC standard는 두 가지 기술로 나뉜다. media capture devices와 peer-to-peer 연결이다. media capture devices는 비디오 카메라, 마이크 그리고 화면 캡쳐 'devices'를 포함한다. 카..