All Products
Search
Document Center

CDN:Video seeking

Last Updated:Nov 21, 2024

The video seeking feature helps users navigate through video or audio content by dragging the playback progress bar. When a user adjusts the playback position, the client sends a URL request to the server to load the desired segment. The enables users to seek to a specific position without compromising the playback quality when they play video or audio content. This topic describes how to configure video seeking.

Note

After you enable video seeking, the time to first byte (TTFB) is increased by about 30 ms.

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 or customize parameters for video seeking

    Time-based FLV Seeking

    Turn on Time-based FLV Seeking.

    Customize Parameters
    1. Click Modify to the right of Custom Parameters.

    2. In the Customize Parameters for Video Seeking dialog box, customize the start and end parameter names.

        Note

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

    3. Click OK.

Request format

The following table describes the supported file formats for video seeking and sample URLs.

File format

Metadata

Start parameter

Example

MP4

The metadata of a video 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, Alibaba Cloud CDN automatically locates the last keyframe before the position.

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

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

FLV

Video 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.

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

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

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