All Products
Search
Document Center

Object Storage Service:How do I play online videos uploaded to OSS?

Last Updated:Mar 20, 2026

OSS supports three video upload methods — the OSS console, OSS SDKs, and Real-Time Messaging Protocol (RTMP) stream ingest — and the playback approach depends on which method you used. This guide covers how to get a playable URL for each method and how to fix the most common playback issues.

Choose your playback path

Upload methodPlayback scenarioWhat to do
OSS console or SDKOn-demandGet the object URL and open it in a browser or player — details below
RTMP stream ingestLive (during ingest)Use HTTP Live Streaming (HLS) — details below
RTMP stream ingestOn-demand (after ingest)Call PostVodPlaylist to build an M3U8 playlist, then use the object URL — details below
Important

By default, the OSS domain forces a file download instead of a browser preview. To enable in-browser playback, map a custom domain to your bucket. See Enable in-browser preview with a custom domain.

Play videos uploaded via the OSS console or SDKs

OSS serves objects through public API operations. To play a video uploaded via the OSS console or an OSS SDK:

  1. Get the URL of the video object. See Share objects with signed URLs.

  2. Open the URL in a browser or media player.

The object URL has this structure:

https://<bucket-name>.<endpoint>/<object-key>

For example: https://examplebucket.oss-ap-southeast-1.aliyuncs.com/videos/sample.mp4

If the URL triggers a download instead of playing the video, you are accessing the object through the default OSS domain. Map a custom domain to your bucket to enable preview. See Enable in-browser preview with a custom domain.

Play videos uploaded via RTMP stream ingest

Live streaming

During stream ingest, use HLS to play the video in real time:

PlatformHow to play
Android and iOSEnter the LiveChannel streaming URL in the browser. Use ListLiveChannel to get the URL.
macOSUse Safari.
Other desktop platformsUse VLC media player.

On-demand playback

After stream ingest completes:

  1. Call PostVodPlaylist to assemble an M3U8 playlist object from the ingested transport stream (TS) segments.

  2. Use the resulting M3U8 object URL to play the video.

In on-demand playback scenarios, you can set a larger group of pictures (GOP) size to reduce the number of TS objects and lower the bitrate.

Enable in-browser preview with a custom domain

The default OSS domain adds the following headers when either of these conditions is met:

  • OSS was activated after 00:00 on October 9, 2022 and you access the object using a default OSS domain.

  • Transfer acceleration was enabled for the bucket after 11:07 on November 17, 2020 and you access the object through the acceleration endpoint.

x-oss-force-download: true
Content-Disposition: attachment

The Content-Disposition: attachment header forces a download instead of a preview. Mapping a custom domain to your bucket removes these headers and enables in-browser preview.

A custom domain also unlocks:

  • Hotlink protection: Restrict which sites can embed your videos by configuring a Referer allowlist. See Hotlink protection.

  • HTTPS: Serve videos over HTTPS by hosting an SSL certificate on the custom domain. See Host SSL certificates.

  • Separate download and preview URLs: Generate signed URLs with Content-Disposition: attachment (download) or Content-Disposition: inline (preview) for the same object. See sign (generate signed object URLs).

To map a custom domain, see Map custom domain names.

Domain registration requirements:

CNAME propagation typically takes several minutes to several hours, depending on TTL settings, DNS cache, and DNS propagation. If the bucket is inaccessible after mapping, verify your CNAME record configuration and wait for propagation to complete.

FAQ

Why does my browser fail to play the video?

Two common causes:

  • Unsupported format: Most browsers do not support M3U8 natively (Safari is an exception). Use ApsaraVideo Media Processing to transcode the video to a broadly supported format such as MP4.

  • Missing MIME type: OSS infers the Multipurpose Internet Mail Extensions (MIME) type from the file extension. If the object has no extension, the browser may not recognize it as a video. Set the Content-Type header manually. See How do I configure the Content-Type header?.

How do I make a video permanently accessible via its URL?

Set the object's access control list (ACL) to public-read-write. See Object ACLs.

Warning

Setting the ACL to public-read-write allows all Internet users to access the object. This may result in unexpected access and unexpectedly high fees. Use this setting with caution.

How do I edit or transcode videos stored in OSS?

Use ApsaraVideo Media Processing to edit, watermark, and transcode videos. See What is ApsaraVideo Media Processing?.