After you enable the preview feature, Alibaba Cloud CDN (CDN) points of presence (POPs) return only audio and video data of a specified duration for preview. This enables use cases such as trial playback for non-members.
Usage notes
The preview feature supports only TS and MP3 files. To preview FLV or MP4 files, enable the video seeking feature and set the end parameter. For more information, see Video seeking.
TS files refer to complete, long-form video files with the .ts extension, not the TS segments that are generated by HTTP Live Streaming (HLS).
Procedure
Log on to the ApsaraVideo VOD console.
In the left-side navigation pane, choose Configuration Management > CDN Configuration > Domain Names.
On the Domain Names page, find the domain name that you want to manage and click Configure in the Actions column.
On the page that appears, click Video Related.
In the Audio/Video Preview section, turn on Audio/Video Preview and specify Custom Preview Parameter.
The Custom Preview Parameter that you specify must be included in the preview request.
After you send a preview request, the CDN POP returns only audio and video data of a specified duration, measured in seconds. For example, if you specify free_time for Custom Preview Parameter and include free_time=15 in a preview request, the CDN POP returns only 15 seconds of audio and video data.
NoteYou need to specify only the parameter name for Custom Preview Parameter in ApsaraVideo VOD. The preview duration is specified in the preview request.
If the specified preview duration exceeds the total file duration, the entire file is returned. For more precise control, we recommend setting the value in the client request slightly higher than the intended preview duration. For example, to provide a 13-second preview, set the parameter value to 15 in the client request.
Click OK.