Live Streaming - Overview

This page provides an overview of live streaming - how to use, integrate and implement.

Introduction

This document outlines the technical details for integrating and utilising the live video streaming application designed for AI Cams (vendorId - 15). The application enables users to live stream videos through a web interface. To initiate live streaming, specific parameters must be provided with the application URL.

This Live Streaming Module offers a range of benefits, including seamless integration into the UI, ease of use, support for multiple cameras, and high customisability. These features combine to provide users with a powerful tool for accessing and managing live video feeds. Whether for monitoring, analysis, or any other application, this module delivers a reliable and flexible solution.

Key Benefits

Seamless Integration in the UI, Easy to Use:

The Live Streaming Module is seamlessly integrated into the existing user interface, ensuring a cohesive and intuitive user experience. Its user-friendly design makes it easily accessible and navigable for all users.

Support for Multiple Cameras:

This module supports multiple cameras, allowing users to view feeds from various sources including road-facing, driver-facing, and auxiliary cameras. This versatility provides users with comprehensive visibility, enhancing situational awareness.

Easily Customisable:

The Live Streaming Module is designed with customisation in mind. Users have the flexibility to tailor settings and preferences to meet their specific needs and preferences. This adaptability ensures that the module can be optimised for a wide range of use cases.

Parameters for Live Streaming

To initiate live streaming, the following fields must be provided as parameters with the application URL. Please refer to Live Streaming API documentation & Camera Wakeup API documentation for more details.

  1. Camera Type: This refers to the online lens Ids of the relevant camera.
  2. IMEI: The International Mobile Equipment Identity (IMEI) number of the device.
  3. Token: The token used to obtain the media address and video URLs.

📘

Did you know?

Streaming is feasible only when the camera is in online mode.

If the video only streams black, it may be because the lens is covered by the lens cover accessory

If camera is in standby / offline - recommend to Wakeup the camera and initiate request again.

Please refer to Camera Wakeup API documentation for more details.

Embedding in HTML

To incorporate the application into a webpage, an iframe can be used. The application URL should be set as the source (src) for the iframe. The following HTML code demonstrates this:

liveStreamData.url = https://svp.azuga.com/

<div class="live-stream-iframe">
   <iframe  id="frame" src=<liveStreamData.url> >
   </iframe>
 </div>

Sending Data via Iframe

To send data to the iframe, the following method can be used. orgToken refers to the organisation's bearer token, and serviceUrl is the service URL of the organisation.

sendDatatoIframe(): void {
const iframe: any = document.getElementById("frame");
const sendMessage = () => {
const message = {
...this.liveStreamGetData,
orgToken: <token>
};
if (iframe) {
iframe.contentWindow.postMessage(message, '*');
}
};
if (iframe && iframe.contentWindow) {
// Iframe is already loaded, send the message
sendMessage();
} else {
// Iframe is not loaded yet, listen for 'load' event
iframe.addEventListener('load', sendMessage);
}
}