This article is part of the content source http://blog.lmxp.com/show.php?id=58, mainly explaining how to play video on demand with the RealPlayer page.
[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,
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.
When the test is found, the embedded RealPlayer is typically played with the video file throughout the video when playing the 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 is an example of IE6.0 as an example, and a method of implementing an embedded web video on demand system is illustrated. (Hereby mainly written with code related code)
Private void playvod (string strurl) {// judgment extension String strproname;
Int lastnum = Strull .lastIndexof ("."); strproname = Strurl.Substring (lastnum);
Switch (strproname) {case ".rmvb": case ".rm": // Defines play interface LitPlay.Text = "
// Define status bar LitPlay.Text = "
Break; Case ".wmv": // Call the MediaPlayer player, omitted the relevant code Break;}
Among them, the Controls parameter is used to specify the appearance of the control of the player, and can be combined with multiple controls and associated with the console parameter. For Param parameters, readers can refer to RealPlayer official website http://service.real.com/help/library/guides/Production/htmfiles/Control.htm. The SRC parameters here are particularly important, used to specify the URL address of the video stream file.