百度智能云

All Product Document

          CDN

          Set the Video Drag and Drop

          Overview

          CDN supports to drag videos in flv and mp4 type. Enabling drag reduces the origin rate and increases the speed.

          Principle Introduction

          • MP4

            Baidu AI Cloud CDN supports pseudo-streaming playback of MP4 files. Usually these files have the extension of .mp4, .m4v and .m4a.

            In a typical Flash player (it may vary for different players), if you drag the progress bar, the player sends an HTTP(S) request with a specified time parameter in the query parameters of the request (usually the parameter name is start, in seconds), and the server responds to the video stream starting at this time. E.g.: http://example.com/elephants_dream.mp4?start=238.88. Similarly, you can also assign the end time (the parameter is normally named as end, with the unit of second), and the server responses the video content of the assigned range from start to end. E.g.: http://example.com/elephants_dream.mp4?start=238.88&end=555.55.

            This helps your Flash player realize process bar dragging feature based on the server.

          • FLV

            Baidu AI Cloud CDN also supports pseudo-streaming playback of Flash Video (FLV) files. Usually these files have the extension of .flv.

            The pseudo-streaming mode of FLV files is different from MP4: FLV files are dragged by byte offset of the file.

            Usually (different players may be different), in the process that a user plays a FLV file in the FLash player, when the user drag the progress bar, the player sends a HTTPS (S) request, and the specified file byte offset parameter (usually parameter name is start, with the unit of byte) is carried in the query parameter of such request. The server responds with two different contents according to the configuration:

            • byte mode: The server responds to the file content starting from the byte specified by start in the original FLV file.
            • byteav mode: The server adds the first Video Tag and Audio Tag (usually Metadata) before the content specified by the start byte in the original FLV file as a response. You can reset the decoding parameters of the player because this mode contains Metadata.
              That is, byteav mode responds to two more tags (Metadata) than byte mode.

          Background Information

          CDN video drag-drop feature supports you to custom settings for "suffix list", "start parameter name" and "end parameter name".

          Drag in seconds for the mp4 type and in bytes for the flv type.

          You can configure it as “by byte--byteav " or “by byte-byte”. If it is byteav, the CDN system adds the first audio tag and the first video tag in the FLV to the result returned. Please select the configuration according to actual conditions.

          • Suffix list

            Suffix is the file suffix name. The suffix of MP4 file defaults to “mp4”, and that of flv file defaults to “flv”. As different users have different definitions for the suffix name of the file types, you can enter the suffix name, one or more, which meet the requirements of your own specifications in the video drag-and-drop setting, and multiple suffix names should be separated by commas.

          • Start parameter name

            It is a parameter indicating the start time of video drag, which is default as “start”. As each user's definition and identification of the video start parameter are not exactly the same, the user can change the parameter name according to the actual situation. CDN recognizes the start parameter value you set as the start time or byte.

          • End parameter name

            Parameter indicating the end time of video drag, the default is “end ". As each user's definition and identification of the video end parameter are not exactly the same, the user can change the parameter name according to the actual situation. CDN identifies the end parameter value set by the user as the end time or byte.

          Setting Example

          If user A sets the suffix value of mp4 as “mp4V”, start parameter name and end parameter name are set as “start1” and “end2” respectively. The address of the user's video request is:

          http://a.com/b.mp4v?start1=200&end2=500

          CDN recognizes a file with the suffix “mp4v” as an mp4 file, directly resolve the values corresponding to start1 and end2 parameters, and return relevant contents to you.

          Set Video Dragging

          1.Log in CDN Management Console, select Domain Name Management from the Navbar on the left of the console.

          2.On the Domain Name Management page, select the domain name that needs to set HTTP header, and click Management in the action bar to the far right, as shown in the figure below.

          image.png

          3.On the Domain Name Details page, click Advanced Configuration, as shown in the figure below.

          image.png

          4.Select Video Drag-and-Drop Configuration on the Advanced Configuration tab.

          image.png

          5.Click Edit behind "MP4" or "flv" type, and set corresponding parameters.

          image.png

          6.Click OK to complete the configuration.

          7.According to the actual condition, you can adjust the video drag status to “on” or “off”.

          Previous
          WAF Configuration
          Next
          SEO优化配置