Video seeking

更新时间:
复制 MD 格式

Video seeking allows you to jump to any point in an audio or video file without affecting the playback experience.

Overview

In video on-demand (VOD) scenarios, when a user seeks to a specific position, the client sends a URL request to the server, such as http://www.aliyundoc.com/test-****.flv?start=10. The server responds with content starting from the keyframe that immediately precedes the requested position (the 10th byte in this example), unless the position corresponds to a keyframe.

Before you can use video seeking, you must enable range back-to-origin. If an HTTP request includes a Range header, your origin server must respond with a 206 Partial Content status code and the requested data.

The following table lists the supported file formats and URL formats.

File format

Metadata

Start parameter

Example

MP4

The metadata of the video on the origin server must be at the beginning of the file. Videos with metadata at the end are not supported.

Specifies the time in seconds. The CDN seeks to the keyframe that immediately precedes the specified time, unless the start value corresponds to a keyframe. Decimal values are supported. For example, start=1.01 begins playback at 1.01 seconds.

The URL request http://www.aliyundoc.com/test-****.mp4?start=10 starts video playback from the 10-second mark.

FLV

The video file on the origin server must contain metadata.

Specifies the offset in bytes. The CDN seeks to the keyframe that immediately precedes the specified byte offset, unless the offset corresponds to the start of a keyframe.

The URL request http://www.aliyundoc.com/test-****.flv?start=10 starts video playback from the keyframe that precedes the 10th byte.

Procedure

  1. Log in to the ApsaraVideo VOD console.

  2. In the left-side navigation pane, under Configuration Management, click CDN Configuration > Domain Names.

  3. Find the domain name that you want to configure and click Configure in the Actions column.

  4. Click the Video Related tab and turn on the Drag/Drop Playback switch.