All Products
Search
Document Center

CDN:Configure video seeking

Last Updated:Apr 01, 2026

Video seeking lets viewers jump to any point in an on-demand video or audio file without downloading the entire file first. This topic describes how to enable video seeking in the Alibaba Cloud CDN console.

Enabling video seeking increases time to first byte (TTFB) by approximately 30 ms.

How it works

When a viewer drags the playback bar to a new position, the player sends a URL request with a start parameter to CDN. CDN identifies the nearest preceding keyframe at or before that position and streams the video clip from there, delivering a seamless playback experience.

When the start value does not land on a keyframe, CDN seeks back to the last keyframe before that position. The actual playback starts slightly earlier than the requested timestamp. If your application requires frame-accurate seeking, account for this offset on the client side.

Prerequisites

Before you begin, ensure that:

  • The origin server supports HTTP Range requests

  • The Ignore parameters feature is disabled on the accelerated domain name

Video seeking uses start and end query parameters to identify the playback segment. If Ignore parameters is enabled, CDN strips these parameters before forwarding requests to the origin, which breaks seeking behavior.

Supported file formats

Video seeking supports MP4 and FLV files. Each format has different metadata requirements and parameter units.

MP4

MP4 files store metadata in a structure called the moov atom, which holds the index information for the entire file. The player must read this metadata before it can seek to any position.

The moov atom must be in the file header. If it is at the file tail, the origin server must transmit the entire file before the player can begin seeking, which defeats the purpose of video seeking.

AttributeDetails
Metadata locationFile header (not file tail)
`start` parameter unitSeconds, up to three decimal places (for example, start=1.01)
Example URLdomain/video.mp4?start=10 — plays from the 10th second

FLV

For FLV files, the video must contain metadata. By default, the start parameter specifies a byte offset. Enable Time-based FLV Seeking to use seconds instead.

AttributeDetails
Metadata requirementFile must contain metadata
Default `start` unitBytes (decimals rounded down to the nearest positive integer)
`start` unit with Time-based FLV SeekingSeconds
Example URL (bytes)domain/video.flv?start=10 — plays from the keyframe preceding byte 10

Choosing a seek mode for FLV:

  • Byte-based seeking — suited for precise data processing or raw video workflows

  • Time-based seeking — suited for end-user playback; jumps directly to the requested second

Enable video seeking

  1. Log on to the Alibaba Cloud CDN console.

  2. In the left-side navigation pane, click Domain Names.

  3. Find the accelerated domain name to configure, then click Manage in the Actions column.

  4. In the left-side navigation tree, click Video.

  5. In the Video Seeking section, turn on the Video Seeking switch.

  6. (Optional) To use time-based seeking for FLV files, turn on Time-based FLV Seeking.

  7. (Optional) Modify Custom Parameters as needed.

Parameter processing logic

The following tables show how CDN handles different combinations of start and end values. These examples use time-based seeking with the default start and end parameters.

MP4

ConditionExampleResult
Both start and end are invalidstart=foo&end=barReturns the complete video
start is valid; end is invalidstart=10Seeks from second 10 to the end
start is invalid; end is validend=10Seeks from 0 to second 10
Both start and end are validstart=0&end=10Seeks from 0 to second 10
Both start and end are 0start=0&end=0Returns the complete video
start > endstart=10&end=0Seeks from second 10 to the end
start = endstart=10&end=10Seeks from second 10 to the end
start exceeds video durationReturns HTTP 400

FLV

ConditionExampleResult
Both start and end are invalidstart=foo&end=barReturns the complete video
start is valid; end is invalidstart=10Seeks from position 10 to the end
start is invalid; end is validend=10Seeks from 0 to position 10
Both start and end are validstart=0&end=10Seeks from 0 to position 10
Both start and end are 0start=0&end=0Returns the complete video
start > endstart=10&end=0Seeks from position 10 to the end
start = endstart=10&end=10Seeks from position 10 to the end
start exceeds video durationReturns the complete video
When start exceeds the video duration, MP4 returns HTTP 400 but FLV returns the complete video.

What's next

To configure video seeking through the API, call BatchSetCdnDomainConfig. For a full list of configurable parameters, see Feature settings for domain names.