Mark Ku's Blog

Live Streaming Website Development Notes - Using Alibaba Cloud

Understanding Push-Stream and Pull-Stream

  1. Push-stream — the process of sending a live video stream from a local source to a Media Server.
  2. Pull-stream — the process of connecting to a server that already has live content, establishing a connection using a protocol (RTMP, RTP, RTSP, HTTP, etc.), and pulling the data stream.
Live streaming architecture diagram with push, pull servers, CDN, and clients
Live streaming architecture diagram with push, pull servers, CDN, and clients

Setting Up Push-Stream and Pull-Stream Servers on Alibaba Cloud

  1. Log in to the Alibaba Cloud console > Video Live > Live Console > Domain Management > Add Domain (select "overseas" to bypass China website review) > Enter your push-stream subdomain push.xxx.com > Submit. Alibaba Cloud Live Console adding push domain with overseas acceleration

  2. Return to the domain list. Alibaba Cloud console showing push.markkulab.net domain added successfully

  3. Add a pull-stream domain > Return to the domain list > Enter your pull-stream subdomain pull.xxx.com. Alibaba Cloud console adding pull stream domain with overseas CDN acceleration

  4. At this point, ask your Infra Team to configure the CNAME records that Alibaba Cloud provides in your DNS host, pointing your domains to Alibaba Cloud's live streaming servers. Alibaba Cloud domain management showing CNAME records for streaming domains Alibaba Cloud CNAME record configuration form for 'pull' domain Alibaba Cloud DNS CNAME record configuration form

  5. Return to the domain management list. Once the domain status changes from "configuring" to "running normally," you need to associate the push-stream and pull-stream domains. Go to the pull-stream domain (pull.xxx.com) > Domain Configuration > Push-Stream Info > Add Push-Stream Info > Enter the push-stream domain push.xxx.com. Alibaba Cloud console with push stream domain entry dialog

  6. When the association is complete, you'll receive the stream playback info (the highlighted portion — you'll paste this into your streaming software). Alibaba Cloud console showing highlighted push stream URL

  7. Configure HTTP headers for the pull-stream domain; otherwise, embedding the stream in a website will be blocked by the browser's CORS mechanism => Access-Control-Origin = * Alibaba Cloud console setting Access-Control-Allow-Origin HTTP header

Pushing the Live Stream to the Cloud via Streaming Software

  1. Go back to the Alibaba Cloud domain list > push-stream domain (push.xxx.com) > Domain Configuration > Access Control > Get the RTMP URL for the push stream. Alibaba Cloud console: RTMP push stream URL authentication settings
  2. Install OBS (Open Broadcaster Software).
    Official download link
  3. Open OBS > Settings > Stream > Fill in the Alibaba Cloud live server address and stream key. OBS Studio stream settings showing server and stream key fields
  4. Click the + button to select the content to stream. OBS Studio add source menu with Text GDI+ highlighted
  5. Click "Start Streaming" — the live video will now be pushed to Alibaba Cloud's push-stream server. OBS live streaming interface with Alibaba Cloud setup guide
  • At this point you can access the Baidu HLS (m3u8) live stream directly on a mobile device.
  • Chrome requires the Native HLS Playback extension or embedding the stream via a player in the website.

Embedding the Live Stream in a Website

  1. Go to the Alibaba Cloud Live console, click "URL Generator," and it will generate playback URLs in various formats. Alibaba Cloud Live console URL Generator showing playback URLs
  2. Fill in the m3u8 URL provided by Alibaba Cloud into the sample code below.
<!DOCTYPE html>  
<html>  
<head>  
<meta charset="utf-8">  
<meta http-equiv="x-ua-compatible" content="IE=edge" >  
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>  
<title>Aliplayer在线配置</title>  
<link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.8.1/skins/default/aliplayer-min.css" />  
<script type="text/javascript" charset="utf-8" src="https://g.alicdn.com/de/prismplayer/2.8.1/aliplayer-min.js"></script>  
</head>  
<body>  
<div class="prism-player" id="player-con"></div>  
<script>  
var player = new Aliplayer({  
  "id": "player-con",  
  "source": "http://ali.v3u.cn/v3u/live.m3u8",  
  "width": "100%",  
  "height": "500px",  
  "autoplay": true,  
  "isLive": false,  
  "rePlay": true,  
  "playsinline": true,  
  "preload": true,  
  "controlBarVisibility": "hover",  
  "useH5Prism": true  
}, function (player) {  
    player._switchLevel = 0;  
    console.log("播放器创建了。");  
  }  
);  
</script>  
</body>

Live Stream Preview

OBS Studio interface showing live stream preview and time comparison
OBS Studio interface showing live stream preview and time comparison
Web browser displaying Aliplayer configuration and a video player
Web browser displaying Aliplayer configuration and a video player

Real-World Measurements (without optimized configuration or CDN acceleration)

  • RTMP video latency: 3–5 seconds
  • HLS video latency: 8–10 seconds

Note — If You See This Screen

This usually means the stream was not pushed correctly, or it was blocked by CORS. Alibaba Cloud live stream player m3u8 manifest load error screen

Author

Mark Ku

擁有 10+ 年經驗的資深軟體工程師,現為 AI 應用 Builder,專注於大型平台架構與簡化複雜系統設計,從電商系統到訂閱與收費平台,結合 AI Agent、AI 整合與自動化開發,打造高效率且可持續演進的產品技術基礎。Read More

Found this useful?

The author's free tools, daily podcasts and newsletter are all here.

Mark Ku · This article is licensed under CC BY 4.0. Credit the author and link back to the original when reusing it.

Comments

Subscribe to Newsletter

Subscribe to get new posts delivered instantly — never miss a tech share.

By submitting, you agree to receive emails. You can anytime.

Popular Posts

View all
Mark Ku
··602

Oracle Cloud Always Free Tier: Linux Host and Static IP for a $0 Cloud Solution

Oracle Cloud Always Free Tier: Linux Host and Static IP for a $0 Cloud Solution
Mark Ku
··490

Say Goodbye to Postman's Fee Trap! A Hands-on Guide to Bruno, the Open-Source Git-Native API Testing Powerhouse.

Say Goodbye to Postman's Fee Trap! A Hands-on Guide to Bruno, the Open-Source Git-Native API Testing Powerhouse.
Mark Ku
··333

A Free, Open-Source, Notion-like Knowledge Base — A Complete Guide to Deploying and Backing Up Outline Wiki

A Free, Open-Source, Notion-like Knowledge Base — A Complete Guide to Deploying and Backing Up Outline Wiki
Mark Ku
··264

Training Your Own AI Voice: Hardware Requirements, Open-Source Model Comparison, and LoRA Fine-Tuning

Training Your Own AI Voice: Hardware Requirements, Open-Source Model Comparison, and LoRA Fine-Tuning
Mark Ku
··221

Building an Efficient API Management Platform: Deploying Kong Gateway from Scratch - Part 1

Building an Efficient API Management Platform: Deploying Kong Gateway from Scratch - Part 1
Mark Ku
··215

Setting Up Samba on Ubuntu to Share Folders with Windows 11

Setting Up Samba on Ubuntu to Share Folders with Windows 11