You can integrate ApsaraVideo Player SDK for web into your web applications. The software development kit (SDK) provides video playback for live streaming and video-on-demand (VOD) scenarios. This topic describes the features of ApsaraVideo Player SDK for web and its browser compatibility.
Overview
ApsaraVideo Player SDK for web uses the <video> tag of HTML5 (H5) to play videos in web applications. The SDK is compatible with multiple browsers, such as Chrome and Safari, to ensure consistent video playback across various platforms. When used with ApsaraVideo Live and ApsaraVideo VOD, ApsaraVideo Player SDK for web also supports features such as hotlink protection, encrypted playback for copyrighted videos, and quality monitoring.
License upgrade
Starting December 1, 2024, you must obtain a license to use ApsaraVideo Player SDK for web V2.28.0 and later. For instructions, see Manage licenses. If you use a version earlier than 2.28.0, you are not affected by this change. However, we recommend that you upgrade to the latest version to receive more comprehensive services and support.
Supported protocols
VOD scenarios
The following table describes the VOD playback protocols and encoding formats supported by the ApsaraVideo Player SDK for web.
Video encoding format | Video protocol | Audio file format | Audio coding format |
H.264 |
| MP3 | AAC |
H.265 Note
|
| - | |
H.266 Note
| MP4 | - |
Live streaming scenarios
The following table describes the live streaming playback protocols and encoding formats supported by the ApsaraVideo Player SDK for web.
Video encoding format | Video protocol | Audio coding format | Audio file format |
H.264 | HLS, FLV, RTS, DASH | AAC | - |
H.265 | HLS, FLV (codecId=12) | ||
H.266 | HLS, FLV |
The following table describes the benefits and limits of each live streaming protocol.
Live streaming protocol | Advantage | Disadvantage | Latency |
HLS | High browser compatibility. | High latency. | > 10s |
FLV | Supports high-concurrency scenarios and is more suitable for native apps. | Browsers must be integrated with ApsaraVideo Player SDK for web for playback. | 1s to 3s |
RTS | Performs well in poor network conditions. Videos can be played smoothly even with a packet loss rate of 30%. | Browsers must be integrated with ApsaraVideo Player SDK for web for playback. | < 1s |
DASH | Adaptive bitrate. | High latency. | > 10s |
Browser compatibility
Desktop browser compatibility
To play FLV and HLS videos on desktop browsers, you must enable cross-domain access.
Browser | MP4 | FLV | HLS | MP3 |
Chrome | ✓ | 34 and later | 34 and later | ✓ |
Firefox | ✓ | 49 and later | 49 and later | ✓ |
Edge | ✓ | ✓ | ✓ | ✓ |
Opera | ✓ | ✓ | ✓ | ✓ |
Safari | ✓ | 8 and later | 8 and later | ✓ |
Mobile browser compatibility
ApsaraVideo Player SDK for web does not support FLV video playback on mobile devices.
Table 1. H5 browser compatibility on Android
Browser | HLS | MP4 | MP3 | FLV |
Chrome | 34 and later | ✓ | ✓ | × |
Firefox | 49 and later | |||
✓ | ||||
Edge | ✓ | |||
Opera | ✓ |
Table 2. H5 browser compatibility on iOS
Browser | HLS | MP4 | MP3 | FLV |
Chrome | 34 and later | ✓ | ✓ | × |
Firefox | 49 and later | |||
✓ | ||||
Edge | ✓ | |||
Opera | ✓ | |||
Safari | 8 and later |
Feature compatibility
Feature | Desktop | Mobile | How to set |
Full-screen playback | By default, videos are not played in full screen. | By default, videos are played in full screen. Different settings are required for different scenarios. Note
| |
Autoplay | The restriction comes from the browser, not from ApsaraVideo Player SDK for web.
| Disabled by default. Special settings are required to enable it. Note Some browsers and WebViews may allow autoplay. This is common in Android systems. | |
Volume adjustment | Supported | Because the | |
Playback speed | Supported | Some mobile browsers do not support playback speed adjustment, such as WeChat on Android. | |
HLS standard encrypted video playback |
| Supported | |
Alibaba Cloud proprietary HLS encryption Note For security reasons, Alibaba Cloud proprietary cryptography does not support debugging with real encrypted videos. |
Note Some third-party browsers forcibly hijack the player. This disables Alibaba Cloud proprietary cryptography and causes playback failure. In this case, use HLS standard encryption or DRM encryption. |
| |
Playback of DRM-encrypted live streams | Windows
macOS
| iOS
Android
| |
Playback of DRM-encrypted VOD streams | Windows
macOS
| iOS
Android
|