ApsaraVideo Player SDK for Web

Updated at: 2025-03-13 01:51

You can integrate ApsaraVideo Player SDK for Web into your web applications and use the SDK for live streaming and video playback on demand. This topic describes the features of ApsaraVideo Player SDK for Web and its compatibility with browsers.

Overview

ApsaraVideo Player SDK for Web uses the <video> tag of the HTML5 player to play videos in web applications. ApsaraVideo Player SDK for Web is compatible with multiple browsers such as Chrome and Safari to provide unified video playback effects on multiple platforms. ApsaraVideo Player SDK for Web also supports features such as hotlink protection, encrypted video playback, and quality monitoring based on ApsaraVideo Live and ApsaraVideo VOD.

License service update

Starting from December 1, 2024, the license service is required before you can use ApsaraVideo Player SDK for Web 2.28.0 and later. For more information, see Manage licenses. Versions earlier than 2.28.0 are not affected by this change. However, we recommend that you upgrade to the latest version for more comprehensive services and support.

Supported protocols

VOD scenarios

The following table describes the playback protocols and codecs supported by ApsaraVideo Player SDK for Web.

Video codec

Video protocol

Audio file format

Audio codec

Video codec

Video protocol

Audio file format

Audio codec

H.264

  • MP4

  • FLV

  • HLS

MP3

AAC

H.265

Note
  • If you want to play H.265 videos, you must submit a request on Yida to apply for a license.

  • Specific browsers do not support the playback of H.265 videos.

  • If you enable playback of H.265 videos, the loading time is extended and traffic consumption increases.

  • MP4

  • FLV

  • HLS

-

H.266

Note
  • If you want to play H.266 videos, submit a request on Yida to apply for a license.

  • H.266 videos are not supported on specific browsers.

  • If you enable playback of H.266 videos, the loading time is extended and traffic consumption increases.

MP4

-

Live streaming scenarios

The following table describes the live streaming protocols and codecs supported by ApsaraVideo Player SDK for Web.

Video codec

Video protocol

Audio codec

Audio file format

Video codec

Video protocol

Audio codec

Audio file format

H.264

HLS, FLV, RTS, and DASH

AAC

-

H.265

HLS and FLV (codec ID = 12)

H.266

HLS and FLV

The following table describes the benefits and limits of each live streaming protocol.

Protocol

Advantage

Disadvantage

Latency

Protocol

Advantage

Disadvantage

Latency

HLS

HLS is compatible with a variety of browsers.

The latency is high.

> 10s

FLV

FLV supports high concurrency and is suitable for native applications.

Browsers require integration with ApsaraVideo Player SDK for Web to play videos.

1s~3s

RTS

RTS performs well under poor network conditions. You can smoothly play streams even at a packet loss rate of 30%.

Browsers require integration with ApsaraVideo Player SDK for Web to play videos.

< 1s

DASH

Adaptive bitrate is supported.

The latency is high.

> 10s

Adaptation to browsers

Supported browsers on PCs

Important

To play videos in the FLV or HLS format by using browsers on PCs, you must enable cross-origin resource sharing (CORS). For more information, see Configure CORS.

Browser

MP4

FLV

HLS

MP3

Browser

MP4

FLV

HLS

MP3

Chrome

Google Chrome 34 and later

Google Chrome 34 and later

Firefox

Firefox 49 and later

Firefox 49 and later

IE

Internet Explorer 9 and later

  • VOD: Internet Explorer 11 and later for Windows 8.1 and later

  • Live streaming: Internet Explorer 11 and later for Windows 8.1 and later

Important

You cannot play video streams in the FLV format in Internet Explorer 11 for Windows 8 and later. This is because the value of mseLiveFlvPlayback is false in the flv.js file for Internet Explorer 11.

Internet Explorer 11 and later for Windows 8.1 and later

Internet Explorer 9 and later

Edge

Opera

Safari

Safari 8 and later

Safari 8 and later

Supported browsers on mobile devices

Note

ApsaraVideo Player SDK for Web does not allow you to play video streams in the FLV format on mobile browsers.

Table 1. Supported browsers on Android devices

Browser

HLS

MP4

MP3

FLV

Chrome

Google Chrome 34 and later

×

Firefox

Firefox 49 and later

WeChat

Edge

Opera

Table 2. Supported browsers on iOS devices

Browser

HLS

MP4

MP3

FLV

Chrome

Google Chrome 34 and later

×

Firefox

Firefox 49 and later

WeChat

Edge

Opera

Safari

Safari 8 and later

Features supported by browsers

Feature

PC

Mobile device

References

Feature

PC

Mobile device

References

Full-screen playback

By default, the full-screen playback feature is disabled.

By default, the full-screen playback feature is enabled. You can disable the feature based on your needs.

Note
  • The full-screen playback feature cannot be disabled in Safari on iOS devices whose version is earlier than iOS 10.

  • If you play videos in inline mode, you need to modify the video size based on the resolution of transcoded videos. Otherwise, black bars may be displayed.

API operations

Autoplay

The autoplay feature that is provided by ApsaraVideo Player SDK for Web is not supported in specific browsers.

  • Autoplay is not supported in Safari 11 and later on macOS High Sierra.

  • Autoplay is not supported in Google Chrome 55 or later.

By default, autoplay is disabled. To enable this feature, you must configure specific settings.

Note

Specific browsers and WebView-based apps allow autoplay. This commonly occurs on Android devices.

Autoplay

Volume adjustment

Supported

The video.volume property is read-only in iOS and specific Android systems. Therefore, the getVolume and setVolume methods provided by ApsaraVideo Player SDK for Web are invalid for iOS and specific Android systems.

Adjust the volume

Playback speed

Supported

You cannot set the playback speed in specific mobile browsers, including the WeChat browser for Android.

Set the playback speed

Playback of videos encrypted by using HLS

  • Chrome

  • FireFox

  • Safari

  • Edge

  • Internet Explorer 11 and later for Windows 8.1 and later

Supported

Use ApsaraVideo Player SDK for Web

Alibaba Cloud proprietary HLS cryptography

Note

For security reasons, you cannot use actual videos that are encrypted by using Alibaba Cloud proprietary cryptography for debugging.

  • Chrome

  • FireFox

  • Safari

  • Edge

  • Internet Explorer 11 and later for Windows 8.1 and later

Note

Specific third-party browsers may modify the settings of ApsaraVideo Player SDK without your authorization or knowledge. In this case, videos encrypted by using Alibaba Cloud proprietary cryptography cannot be played. To resolve this issue, we recommend that you use the HLS or digital rights management (DRM) encryption method to encrypt videos.

  • This feature is supported on iOS 14 and later.

    Note

    To use this feature on iOS 17.1 or earlier versions, you must install player plug-ins. For more information, see Play an encrypted video.

  • This feature is supported on most Android browsers.

    Note

    Specific browsers may modify the settings of ApsaraVideo Player SDK and hijack video playback without your permission or knowledge. The browsers include UC, Quark, and Baidu, and Wechat, DingTalk, and QQ Browser on iOS 17.1 or earlier versions. In this case, videos encrypted by using Alibaba Cloud proprietary cryptography cannot be played. You can instruct users to play videos on other browsers.

Use ApsaraVideo Player SDK for Web

Playback of live streams encrypted by using DRM

Windows

  • Chrome

  • Opera

  • FireFox

  • Edge

macOS

  • Chrome

  • Safari

  • FireFox

  • Opera

  • Edge

iOS

  • Chrome

  • Safari

Android

  • Google Chrome for Android 10 and later

  • Edge

Use ApsaraVideo Player SDK for Web

Playback of DRM-encrypted VOD files

Windows

  • Chrome

  • Opera

  • FireFox

  • Edge

macOS

  • Chrome

  • Safari

  • FireFox

  • Opera

  • Edge

iOS

  • Chrome

  • Safari

Android

  • Google Chrome for Android 10 and later

  • Edge

  • On this page (1, T)
  • Overview
  • License service update
  • Supported protocols
  • VOD scenarios
  • Live streaming scenarios
  • Adaptation to browsers
  • Supported browsers on PCs
  • Supported browsers on mobile devices
  • Features supported by browsers
Feedback
phone Contact Us

Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

alicare alicarealicarealicare