A blog post which explains how we achieve our Live Streaming Service.
Technology is constantly evolving and this most certainly evident when looking at Web Standards. The majority of the internet is crafting using the Programming Language HTML which has come a long way since it's creation in 1993 and is currently on "Version 5" or HTML5. HTML5 brought about major changes in functionality which we now take for granted, things like Geolocation, better Storage functionality and most importantly in our case; Web-based Real-time Communication (WebRTC).
WebRTC is a very new feature which is still actively being developed and improved upon but now fully released and available in all good internet browsers. WebRTC enables the secure peer-to-peer communication of audio, video and data. In it's simpliest terms, it allows two devices to share audio and video between themselves in a mutually agreed format, and the data is exchanged directly. This allows for minimal latency (the amount of time it takes for the data to be received after it has been sent).
For the purposes of this explanation, the sender of data will be refered to as the "Caller" and the receiver of data as the "Handler", the instance of sharing data will be refered to as a "Stream".
Emerstream's Live Stream functionality builds upon the WebRTC standard, but involves a Media Server, for reasons I will explain shortly.
A session within Emerstream begins when the Handler starts a Stream on the Emerstream Dashboard in their browser, usually by referencing a Call Log reference such as a CAD number, and supplying Emerstream with a Mobile Number for the Caller. We will then issue the Caller with a unique secure link via text message inviting them to share their device camera, microphone and (if requested by the Handler) GPS location data. Once accepted, the device's preinstalled default browser (such as Safari on iOS or Chrome on Android) will open and the Caller will see their camera feed. A secure connection is established between the Caller's mobile device and our Media Server, and audio and video data begins to be stored as a recording. The Handler's browser will be notified of this connection, and rather than connecting directly to the Caller's device, the Handler's browser requests a copy of the Stream from the Media Server. The Handler can now see and hear exactly what the Caller can see and hear.
Both the Caller and Handler have the ability to exchange text messages directly inside the Stream, and the Caller's GPS data (if requested) is also provided and mapped in real time and with accuracy typically around 10 meters.
The Handler has the ability to invite others to view the Stream by issuing secured links which can be restricted to either only allow internal connections (other employees from the same organisation), external secured connections (shared with other organisations who use Emerstream), or single-use share links (when the end-user doesn't have access to an Emerstream account). These invited viewers then request their own copy of the Stream, with the ability to playback previous sections of the stream from the recording.
Once the Stream is ended, either by the Handler or Caller, all parties are disconnected. The recording is however stored subject to the organisation's retention policies and can be accessed in line with the organisations storage and playback policies.
As mentioned earlier, Emerstream uses a Media Server to ingest and process stream data rather than using the typical peer-to-peer model. This is due to three main reasons:
NB. 1Gbps is equivilent to 1000Mbps or 1,000,000Kbps