By Anthony Merrington, Technical Support Engineer at Alibaba Cloud.
Live streaming offers a novel way for businesses to expand their influence, reach new demographics, and promote their brands. It already plays an established role in scenarios such as gaming, online education, and live entertainment events. And in the Chinese market, it is becoming an essential tool in the armory of e-commerce companies. For enterprises hoping to join the trend, however, it can be challenging to build a live streaming app from scratch and without any prior experience.
First, let's go through a few essential features you'll want to consider during app design:
1. Live Streaming
The most fundamental feature of a live streaming app, without doubt, is the live streaming functionality itself. ApsaraVideo Live is an Alibaba Cloud platform that enables live audio and video streaming services with low latency and high concurrency. It supports adaptive streaming bitrate and provides enhanced security. You can easily develop apps for Android and iPhone devices based on the official supported streaming SDK and player SDK.
2. Instant Messaging
To keep viewers involved and boost engagement in your live streaming events, it's important that the audience can share opinions and give feedback whenever they want. With Message Queue for MQTT, your app users can send messages to ask questions and get answers in real-time. The service features the publish/subscribe pattern to implement one-to-many message delivery.
3. Content Moderation
To protect your app users from spam messages and meet compliance requirements, you need to identify and block messages containing inappropriate content before the messages reach your other users. Alibaba Cloud Content Moderation enables you to continuously monitor user-generated messages and create custom blacklists to block messages that contain specific words and expressions.
The following diagram shows the architecture of a live streaming solution built based on Alibaba Cloud products and services.
To set up a solution that looks like this, follow the high-level steps listed below. If that's not enough, note that you can find complete steps, including code samples, by reading the best practice Building Live Streaming Apps Based on Alibaba Cloud Services.
To build a live streaming app with ApsaraVideo Live, you'll need to set up two domains: one streaming domain and one ingest domain. You need to prepare these two registered domains in advance and set them up in the ApsaraVideo Live console.
During the process, you will need to add two CNAME records for these two domains to your DNS hosting provider.
Note that if your audience consists of users from mainland China, you must also obtain an ICP filing or license for your domains before you release your app to the public.
The next step is to download the streaming SDK and player SDK and then import the SDKs to your selected mobile development environment. Both Android and iOS SDKs are provided. You can use the provided SDK tools to develop your client app. You can customize your app to optimize the user experience. You need to create at least three views: one where the app users can identify themselves as either a streamer or a viewer, one where the streamer can start live streaming, and one where the viewer can watch live streams.
Note: You can access the best practice Building Live Streaming Apps Based on Alibaba Cloud Services to get the SDK download links.
You need to build a server application to enable instant messaging among your app users during live streaming. To achieve this, you can integrate Message Queue for Apache RocketMQ and Message Queue for MQTT to implement two-way communication between Alibaba Cloud and mobile devices. You can call the Content Moderation API to monitor user-generated content and block messages based on custom blacklists. Table Store provides distributed storage for moderated messages at low cost. You can also create an Elastic Compute Service instance to host the server application in a secure and reliable manner.
After you have deployed the server application to an ECS instance, you need to update the client app to implement instant messaging. Add UI elements to allow users to type and submit messages, connect to the server application to process the messages, and display moderated messages to both the streamer and the audience. You can then test the client app on real devices to see whether the app functionalities work as expected.
To learn more about building a live streaming app, you can check out the following materials for free:
Related Alibaba Cloud Academy courses:
淘系技术 - November 17, 2020
Alibaba Clouder - February 14, 2020
Alibaba Clouder - July 8, 2020
Alibaba Cloud TC Content - June 25, 2021
Alibaba Clouder - March 5, 2020
Alibaba Cloud MaxCompute - September 18, 2018
This solution provides tools and best practices to ensure a live stream is ingested, processed and distributed to a global audience.Learn More
A professional solution for live video and audioLearn More
Stream sports and events on the Internet smoothly to worldwide audiences concurrentlyLearn More
An array of powerful multimedia services providing massive cloud storage and efficient content delivery for a smooth and rich user experience.Learn More
More Posts by ClouderLouder