All Products
Search
Document Center

CDN:Audio and video preview

Last Updated:Nov 20, 2024

Audio and video preview allows CDN edge nodes to return audio and video files in a specified length to users. This allows non-premium users to preview audios and videos. This topic describes how to configure audio and video preview.

Precautions

This feature supports only M3U8 (HLS) and MP3 files. If you want to allow users to preview FLV or MP4 files, enable the video seeking feature and set the end parameter. For more information, see Video seeking.

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 Audio/video Preview section, turn on Audio/video Preview and set Custom Preview Parameter.

    Enable audio and video preview

    The key and value of the Custom Preview Parameter field must be the same as the one in clients requests.

    CDN edge nodes return audio and video files in the length specified by requests. The length is measured in seconds. For example, if Custom Preview Parameter is set to free_time and a request specifies free_time=15, Alibaba Cloud CDN returns 15 seconds of the requested file to the client.

    Note
    • If you specify only the name of Custom Preview Parameter, but do not specify a value, CDN edge nodes return audio and video files in the length specified by requests.

    • If the file length specified on clients is longer than the total preview length, the total preview length takes effect. We recommend that clients set a length that is slightly longer than the preview length to ensure that the returned files meet the expected length. For example, if a user wants to preview 13 seconds of an audio or video file, they can set the time period to 15 seconds in the request.

  6. Click OK.