Implement instant loading on various clients

更新时间:
复制 MD 格式

Slow first-frame rendering degrades viewer experience, especially in live streaming. ApsaraVideo Live reduces first-frame time to approximately 200 milliseconds through cloud-side intelligent buffering combined with client-side configuration. This guide covers protocol selection for each client type.

How latency is introduced

Delay accumulates at multiple stages before a frame reaches the viewer:

  1. Ingest — the encoder sends the stream to the ingest server over a consumer or cellular network.

  2. Cloud buffering — the server buffers, decodes, and repackages the stream.

  3. CDN delivery — the CDN distributes the packaged stream to edge nodes.

  4. Player startup — the player buffers enough data before rendering the first frame.

ApsaraVideo Live's intelligent buffering feature targets the cloud buffering stage, pre-filling data so the player can begin rendering with minimal startup delay.

Protocol selection by client type

Different clients have different protocol constraints. Choose the protocol that best fits each client's environment:

Client

Recommended protocol

Notes

Native apps (iOS/Android)

HTTP-FLV

More stable and widely used than Real-Time Messaging Protocol (RTMP); recommended for app-based stream playback

PC browsers

Flash player plug-in

Flash player plug-ins require buffering before playback, which makes instant loading difficult

Mobile browsers (iOS Safari)

HTTP Live Streaming (HLS) via M3U8 URL

Hardware decoding on iOS accelerates startup; caching DNS records for streaming URLs further reduces first-frame time

Mobile browsers (Android)

HLS via M3U8 URL

First-frame time depends on the device model and Android version

Why HTTP-FLV over RTMP for native apps

Compared with RTMP, HTTP-FLV uses a more stable protocol structure and is more widely used. We recommend that apps use HTTP-FLV to play streams.

Note

Instant loading relies on cloud-side intelligent buffering, which introduces background latency. The player must actively control this latency to prevent it from growing over time. For interactive scenarios with strict latency requirements, such as live shows, intelligent buffering may not be suitable.