This topic describes the composition and operational process of an interactive streaming project and how to access ApsaraVideo Live by using ApsaraVideo MediaBox SDK.
Project composition
An interactive streaming project consists of the following four components:
Streamer client: provides a series of interfaces for streamers, and allows streamers to create different types of live channels and use special effects such as retouching. Live channels support stream ingest and live comments. In addition, screen sharing and playback of shared videos are supported in landscape mode. In a co-streaming live channel, the streamer can approve or reject video co-streaming requests from viewers.
Viewer client: provides an interface for viewers to view the list of live channels and their current states. Viewers can join an ongoing live channel to watch live streams and send messages to interact with others. They can also replay the live streams that have ended. In a co-streaming live channel, viewers can initiate video co-streaming requests to the streamer.
AppServer: provides a set of easy-to-deploy and flexibly customized backend services for AUI Kits based on services such as Function Compute (FC). In this project, AppServer interacts with ApsaraVideo Live by using live streaming API operations, and calls API operations to record live streams in live channels and allow viewers to replay the live streams that have ended.
ApsaraVideo Live: is an audio and video live streaming platform that is developed based on content access and delivery capabilities and large-scale, distributed real-time transcoding technologies. It provides ultra-low latency and high concurrency, delivers high-definition and smooth video content, and is easy to access. This project provides live streaming, co-streaming, video recording, and group message features.
Operational process
The operational process of an interactive streaming project consists of the following three phases:
A streamer creates a live channel, and viewers join the created live channel. They can send messages in the live channel to interact with each other.
The streamer initiates live streaming in the live channel. The viewers watch the live streams.
A viewer initiates a video co-streaming request to the streamer. After the request is approved, the viewer becomes a co-streamer and starts to ingest live streams. Other viewers watch the mixed live streams of the streamer and co-streamer.
The following flowcharts show the three phases in detail by using time series charts.
The streamer creates a live channel
This section describes how the streamer creates a live channel. The streamer requests AppServer to create a live channel. AppServer calls API operations of ApsaraVideo Live to create a live streaming group and obtain the live streaming URL of the live channel. After AppServer creates livestream room information in the database, including the information about the live streaming group and live channel, AppServer returns the live channel information to the streamer. After that, the streamer can send messages in the live streaming group. Viewers can join the live channel that has not yet started and send live comments.
In this phase, AppServer calls API operations of ApsaraVideo Live to create a live streaming group and return the live channel URL. Therefore, you must configure an ingest domain, configure a streaming domain, and create an interactive messaging (IM) application in the ApsaraVideo Live console.
The streamer initiates live streaming
This section describes how the streamer initiates live streaming in the live channel. After the streamer initiates live streaming in the live channel, the streamer uses ApsaraVideo MediaBox SDK and Queen SDK to ingest the retouched video streams to the live streaming URL. The streamer requests AppServer to mark the live channel as live in the database. Viewers check the list of live channels and join an ongoing live channel to pull streams for watching.
In this phase, clients ingest streams by using the ingest URL. Therefore, you must configure an ingest domain, configure a streaming domain, and create an IM application in the ApsaraVideo Live console.
In this phase, the streamer uses Push SDK and Queen SDK to ingest streams to the ingest URL. Viewers use Player SDK to watch live streams in classes.
The streamer and viewers start video co-streaming
This section describes how viewers co-stream with the streamer. This phase is complex and mainly involves four roles:
Streamer: initiates live streaming in a live channel.
Viewer who requests co-streaming: initiates a video co-streaming request to the streamer.
Co-streamer: has already started video co-streaming with the streamer.
Other viewer: does not initiate a video co-streaming request.
In this phase, clients use Player SDK to watch live streams. You must enable stream relay when you create an IM application and create an Alibaba Real-Time Communication (ARTC) application in the ApsaraVideo Live console.