Embedded web video on demand system implementation method

zhaozj2021-02-08  251

In recent years, the names of video on demulting VOD (Video On Demand) have more and more in the media.

VOD technology allows people to share the video programs and information in the program library in the computer or TV, which can be freely placed in a computer or TV with a video program, a video program and information in a computer or television, which is a video program and information that can be freely selected. .

The essence of the VOD is that the user's user actively obtains multimedia information according to their needs, which distinguishes the maximum difference between the information release: First, the second is selectivity. In a sense, this is the case of information recipients according to their own needs, in this way, this way will become more and more in accordance with the deep needs of information resource consumers in today's information society, can say that VOD is The future mainstream mode of information acquisition is in multimedia video audio. The concept of VOD will expand quickly in the field of information, with unlimited development prospects.

【background】

The unit of the author has an internal website, in order to further improve the availability of the network, improve the functionality of the website, decide to provide video on demand functions on the network. After a period of exploration and comparison, the author finally selected RealSystem's RealPlayer as a video file playing tool, mainly based on the following considerations:

1. RealPlayer supports the vast majority of audio and video streaming media formats, including currently popular MP3 and other audio media;

2, RealPlayer default .RM format while ensuring playback quality, the file compression ratio is higher to make it more beneficial to network transmission;

3, RealPlayer has a wide range of user groups and service providers on the Internet.

Alternatively include Microsoft's MediaPlayer, Apple's QuickTime, etc. For details, please refer to the "Search for Spring" evaluation article: "Three major mainstream streaming media technology comparison" (http://www.souxin.com/stream/txt/3_stream_comp/www.souxin.com.htm)

[Selection of playback]

In general, after installing RealPlayer, there are two ways to choose to connect to the video file. One is the URL address that provides video files directly on the web page. When the user clicks on the link, RealPlayer automatically recognizes and lives in real time; the second method is to embed the RealPlayer object in the web page through the ActiveX control, and via DHTML Dynamically specify a video stream URL for embedded objects, providing a unified friendly interface for video playback.

The former method is relatively simple for designers, and only the playback path of the video file is required. The skilled users of RealPlayer can also perform video management by customizing the visual plugin, adding a visual plugin, adding to a favorites. But this method also has the following defects:

1. For video files containing Chinese paths and Chinese names, the browser does not support well, often can't find an error message such as files.

2, you need a system for file association, if the file is associated, the browser will be at a loss.

3. For end users, it is often desirable to see a unified playback interface instead of pop-up playback.

With web embedded video stream management, the user-ended operation request can be reduced to minimize (the user only needs to install the RealPlayer player). If reciprocally, you can customize the beautiful play interface according to the designer's willingness.

【basic concepts】

Before designing, let's first understand some relevant basic concepts.

1, , tag

is the object definition tab used after IE4.0 after IE4.0, which is used to replace the tag (IE still supports ), defines the corresponding object type by classID attribute. The tag is an object definition tag that the Netscape browser supports. If the developer needs to get support for both IE and Netscape browser users, it is best to use the tag. 2. Define the RAM file

The RAM format file is the same as the RM file, and it is also the video file compression format supported by RealPlayer, where the RAM file can only include the URL address of the video file. That is, the RAM file can be a simple text format, and each line defines the URL address of a video file.

The author found that when playing video files, the author is typically played locally when playing a video file. This is unbearable for larger video files. The method of solving this problem, one is to simply split video files into small file segmentation playback (due to Real "Closed Management" on RM format, RM is not like a video file such as MPEG. Edit the video software); another is the use of a RAM file. RealPlayer Simple Download the RAM file in the text format, then remove the real address, and then automatically connect to the network for real-time point-to-point playback. The disadvantage is to increase the server burden.

Similarly, Microsoft Media Player uses ASX format to define an ASF file.

3, DHTML

DHTML is the abbreviation of Dynamic HTML, DHTML uses CSS (Cascading Style Sheets, Table), and relying on JavaScript to "move" with JavaScript. Netscape 4.0 and IE 4.0 / 5.0 support DHTML, DHTML is a fully "client" technology that implements interactivity between the page and the user directly through the web page. Excellent in DHTML is to enhance the functionality of the web page, establish an animation, games, and application software, etc., provide a new way of browsing sites, different from Java, Flash, etc., the page prepared with DHTML No need to support support will be fully implemented.

【designing process】

The following author uses IE5.0 as an example, a method of implementing an embedded web video on demand system, wherein some PHP and JavaScript technology are used, and if there is a doubtable reader, please refer to the relevant information.

First, insert the RealPlayer ActiveX object (if you want to test, you need to install the RealPlayer player first)

Assume that the following code is included in the Video.php document (this file will be linked via