Insert a video into a webpage

Source: Internet
Author: User
There are two ways to insert a movie into a webpage: one with no player interface and the other with a player interface, neither of these two methods requires complex program code, nor profound program design. follow the steps below to learn how to publish online movies in just a few minutes:

1. Release of movies without a player

This release method does not show a player in a Web browser, but uses the shortcut menu command to control the playback and stop of a movie. The specific sending steps are as follows:

1. Run the FrontPage 2002 program to ensure that the webpage is in the view mode, move the mouse over the menu bar, and execute the "insert"/"image"/"video" command in sequence, then, the system automatically opens a file selection dialog box. In this dialog box, you can select the movie and video files you want to publish and click "OK" in the dialog box, in this way, the target movie can be inserted into the webpage;

2. The inserted movie file is only displayed as a small icon in the webpage editing mode. You can only view the normal content of the inserted movie file when you preview the file or open the webpage using a browser;

3. to enable proper playing of a movie, you also need to set parameters for the inserted movie file to specify the playing mode of the online movie; when setting, you can right-click the video file icon and execute the "image attribute" command from the shortcut menu that is subsequently opened;

4. In the pop-up "image properties" dialog box, you first open the "video" tab page and select "DUPLICATE" options, of course, you can also set a limited number of times for a movie to be played cyclically, and enter a proper number in the number setting column;

5. On this tab page, if you need to pause the video for a period of time and play it again, select the "loop delay" option, at the same time, enter the specific time to pause in milliseconds;

6. You can also set the starting playing mode of an online movie, for example, whether to enable automatic playing of a movie when opening a webpage file, you can also set to enable the mouse to start playing a movie when the screen is suspended. After completing the above settings, you can run the "preview" command to check whether the movie can be played correctly and how it works; if the playback effect is not satisfactory, you can cancel the preview and reset the film playback parameters until the appropriate adjustments are made. Now, you can complete simple movie publishing tasks.

7. If you do not have dedicated tools such as FrontPage, you can directly Insert the movie play code in the webpage source file to publish online movies: you can insert any image into the webpage and use NotePad to open the source code file of the webpage, and find the "

8. Change the "src" Image Tag name in the statement to the video Tag Name "DYNSRC". At the same time, point the tag attribute value to the relative path and file name of the target movie file; for example. if an AVI movie is published online, you can directly Insert "

9. After code insertion, you can save the webpage as an HTML file and use a browser to view the inserted movie. If you find that the inserted movie screen is too small or out of proportion in the browser interface, you can re-open the source code file of the webpage and add the corresponding movie playback control code in it, this allows you to set the screen and playback mode as needed;

10. You can use the "width =" XX "Height =" XX "mark for controlling the movie size in the IMG statement to set the screen size of the movie to be played, if you cancel this tag, the browser will automatically display it in the browser according to the original playback size of the movie;

11. In the IMG statement, you can also add the "Start =" mark for controlling the playing mode of a movie "... "" If you want to automatically play a movie when the webpage is accessed, you can set the value to "Start =" fileopen ""; if you want a movie to start playing when you hover the mouse over the screen, you can set the value to "Start =" Mouseover "", in this way, the film can be automatically played when the mouse is hovering over the screen of the movie;

12. In addition, you can add the mark"

Loop = "... "" to allow online movies to play cyclically as needed. If you set the value to "loop =" infinite ", online movies will automatically play cyclically without limit; however, if you only want to play a movie once, you can not use the "loop" mark;

13. Use "loopdelay = "... "" flag can be used to set the interval of a movie during repeated playback. For example, if the value is set to "loopdelay =" 2, indicates that the pause time is 2 hao seconds.

Through the above settings, a wonderful movie can be played on the webpage normally. Of course, the playing effect of such online movies may not be very satisfactory. To achieve better performance in movie Publishing, you 'd better learn the film publishing technique with a player.
2. Release of a movie with a player

To enable viewers to play and enjoy movies as they wish, you can use the following method to publish a movie with a player:

1. Run the FrontPage 2002 program and execute the "insert"/"Web Components" command in sequence in the menu bar. Then, FrontPage 2002 opens a dialog box titled "Web Components;

2. In the "component type" option of the dialog box, you can select the "advanced control" option and select "ActiveX control" in the "select a control" option;

3. In the "insert ActiveX Control" dialog box, select the "Windows Media Player" option so that a playback Controller Interface is inserted into the webpage, you will be able to see this player when you open this page in your browser;

4. Right-click the player you just inserted and execute the "ActiveX Control Properties" command in the shortcut menu that is displayed. The "options" dialog box is displayed. In this dialog box, select the "play" tab and set the playback parameters on the tab page, such as the number of loop playback times, the size of the playback screen, and the playback volume, to ensure that viewers can easily control online movies on webpages;

5. After setting the playback attribute, you can switch the FrontPage 2002 program interface to the "html" view mode and find the "<Param name =" samifilename "value>" statement in it, set the "value" attribute value in the statement to "value = "*. * "", where "*. * "indicates the name of the movie file to be released online and the relative path of the file. In addition, you can modify the attribute values of other tags of the statement as needed;

6. If you are familiar with HTML syntax, you can also open the source code file of the webpage to manually design the movie playback controller. First, you only need to add the following fields to the HTML source file:

<P>

<Object classid = "CLSID: 22d6f312-b0f6-11d0-94ab-0080c74c7e95"

Id = "mediaplayer1">

<Param name = "FILENAME" value = "*. *">

// Filename indicates the movie name, and *. * indicates the location of the movie file.

<Object>

</P>

Then save the webpage file again so that the webpage can be inserted into the playback controller and movie;

7. Of course, the above is only the most basic code. to better control the playback of a movie, you 'd better Add the following code for playback control in the HTML source file:

<Param name = "playcount" value = "A"> //

A Indicates repeated playback of a movie several times. If the value is 0, the movie will be infinite;

<Param name = "autostart" value = "A"> //

A Indicates whether to play a movie automatically. 1 indicates automatic playback, and 0 indicates playback by pressing a key;

<Param name = "clicktoplay" value = ""

// If A is set to 1, you can click the mouse to control the playback or pause status. If a is set to 0, this function is disabled;

<Param name = "displaysize" value = "A"> // if A is set to 1, playback is performed based on the original size.

<Param name = "enablefullscreen controls" value = ""

// If the value of a is 1, the switch is allowed to be full screen. If the value of 0, the switch is disabled;

<Param name = "showaudio controls" value = ""

// If A is set to 1, the volume can be adjusted. If a is set to 0, the volume cannot be adjusted;

<Param name = "enablecontext menu" value = ""

// If A is set to 1, right-click menus are allowed. If a is set to 0, right-click menus are disabled;

8. Enter the above Code correctly, save the webpage file again, and open the webpage in a browser. Then, you can use the playback controller to play online movies freely on the webpage.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.