Skip to content

Code Structure & Interfaces

Riz Panjwani edited this page Feb 24, 2015 · 1 revision

Capcast is a p2p web-app. Currently, we have a front-end that communicates with a few open-source signalling servers which are implemented in nodejs. As such, we will mostly talk about the front-end code structure.

Index.html, which is located under the capcast -> app directory, constitutes our front-end display. Under the scripts folder, we have two files: main.js and meeting.js. Meeting.js is an open-source p2p video conferencing library, which exposes a Meeting interface.

Main.js is our code that utilizes the Meeting interface and also has binding logic to our page. We have made some modifications to Meeting.js in order to establish DataChannels between peers so that we can send speech-to-text captions back and forth. We have created establishDataChannel callback function which gets passed to the Meeting interface for this purpose.

We make use of Websockets to establish connections with our signalling servers, which in turn broadcast the meeting rooms that are available for our peers to join. Once the peers have connected, the signalling server is not required.

In order to produce speech-to-text, we utilize webkitSpeechRecognition that is available in chrome, and which communicates with Google translation servers. We have an event-handler that fires once we receive a text version of our speech we input into our input-device, which we then promptly send to our peer.

Clone this wiki locally