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 TS 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 of the domain name.
  4. In the management pane 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 returns 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.