All Products
Search
Document Center

CDN:Video seeking

Last Updated:Feb 08, 2025

The video seeking feature helps users navigate through video or audio content by dragging the playback progress bar. This topic describes how to configure video seeking on the CDN console.

Note

After you enable video seeking, the time to first byte (TTFB) is increased by about 30 ms, which may have a minor effect on user experience.

Introduction

When video seeking is enabled, the client sends a URL request to the server to load the desired video segment whenever a user adjusts the playback position. At the same time, CDN identifies the nearest keyframe preceding the specified position if it is not a keyframe. Since a keyframe contains a complete image, this mechanism ensures a seamless keyframe-by-keyframe playback experience for users.

Prerequisites

  • The origin server supports HTTP range requests.

  • The Ignore parameters feature is disabled.

Supported file formats

MP4

The metadata of a MP4 file on the origin server must be included in the file header instead of the file tail.

The start parameter specifies the position in seconds, rounded to the third decimal point. For example, start=1.01 indicates that the playback starts at 1.01 seconds into the video.

  • If the start parameter specifies a position that is not a keyframe, CDN automatically locates the last keyframe before the position.

  • If the start parameter is a keyframe, CDN automatically locates the keyframe.

For example, the request URL http://domain/video.mp4?start=10 specifies that the video is played from the 10th second.

FLV

FLV files on the origin server must contain metadata.

The start parameter specifies the position in bytes. Decimals are not supported, and the value is rounded down to the nearest positive integer. However, If you turn on Time-based FLV Seeking, the unit of the start and end parameters is second.

Note

Seeking by bytes is suitable for precise data handling or when working with raw video data, while seeking by seconds provides a user-friendly experience by moving to the exact second requested.

  • If the start parameter specifies a position that is not a keyframe, CDN automatically locates the last keyframe before the specified position.

  • If the start parameter is a keyframe, CDN automatically locates the keyframe.

For example, the request URL http://domain/video.flv?start=10 specifies that the video is played from the 10th byte.

Procedure

  1. Log on to the Alibaba Cloud CDN console.

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

  3. On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column.

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

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

  6. Optional. Allow FLV files to be sought by time

    Turn on Time-based FLV Seeking.

  7. Optional. Customize parameters for video seeking.

    1. Click Modify to the right of Custom Parameters. In the Customize Parameters for Video Seeking dialog box, customize the start and end parameter names.

      The default names of the start and end parameters are start and end. Parameter names can contain letters, digits, and underscores (_).

    2. Click OK.