Updated on 2024-01-26 GMT+08:00

Video Seek

Background

Video seek is mainly used in VOD scenarios. It allows users to seek to a certain position in a video without affecting the playback effect.

  • If video seek is configured, a user client sends a request similar to the following to the server when the user drags the progress bar during video playback:
    http://www.example.com/test.flv?start=50

    Data starting from the 50th byte is returned to the client. If the video has been cached on a CDN PoP, the CDN PoP directly returns the data to the user.

  • Video seek is valid only when URL parameter filtering is set to Ignore URL Parameters for MP4 and FLV files. For details, see Cache Rules.
  • Video seek is valid only when your origin server supports Range requests.
  • Only MP4 and FLV videos are supported.
Table 1 File formats

File Format

Meta Information

Start Parameter

Example

MP4

The meta information of the video on the origin server must be contained in the header of the file.

The start parameter indicates a time. CDN automatically locates the key frame before the time specified by the start parameter if the specified time is not a key frame. The unit is second and decimal places are supported. For example, start=1.01 indicates that the start time is 1.01 seconds.

http://www.example.com/test.mp4?start=50

The playback starts from the 50th second.

FLV

The video on the origin server must contain meta information.

The start parameter indicates a byte. CDN automatically locates the key frame before the byte specified by the start parameter if the specified byte is not a key frame.

http://www.example.com/test.flv?start=500

The playback starts from the 500th byte.

Precautions

  • Domain names whose service type is whole site acceleration do not support this function.
  • You have configured a cache rule for FLV and MP4 files and set URL Parameter Filtering to Ignore all.

Procedure

  1. Log in to Huawei Cloud console. Choose Service List > Content Delivery & Edge Computing > Content Delivery Network.

    The CDN console is displayed.

  2. In the navigation pane, choose Domains.
  3. In the domain list, click the target domain name or click Configure in the Operation column.
  4. Click the Video Settings tab.
  5. Click Edit next to Video Seek.
    Figure 1 Configuring video seek
  6. (Optional) Enable time-based FLV seek.

    Switch on Time-based FLV Seek, so FLV videos can be sought by time.

    If you enable Time-based FLV Seek, it is valid only when Video Seek is enabled.

  7. (Optional) Configure the start and end parameters.
    • By default, the start parameter is start and the end parameter is end.
    • A parameter can contain up to 64 characters, including letters, digits, and underscores (_).
  8. Click OK.