Explanation of html tags: Object and EMBED tags _ html5 tutorial skills-

Source: Internet
Author: User
To play a Flash video in a browser, HTML documents must contain and tags and set parameters. The OBJECT tag has four settings (HEIGHT, WIDTH, CLASSID, and CODEBASE ), all of them are their attributes. If you are interested, you can understand this article. Definition and usage

Defines an embedded object. Use this element to add multimedia to your XHTML page. This element allows you to specify the data and parameters of objects inserted into the HTML document, as well as code that can be used to display and manipulate data.

Tags are used to contain objects, such as images, audios, videos, Java applets, ActiveX, PDF, and Flash.

The original intention of the object is to replace the img and applet elements. However, this is not implemented due to vulnerabilities and lack of browser support.

The support for browser objects depends on the object type. Unfortunately, mainstream browsers use different codes to load the same object type.

Fortunately, the object provides a solution. If the object element is not displayedAnd. In this way, we can nest Multiple object elements (each corresponding to a browser ).

Use OBJECT and embedded tags
To play a Flash video in a browser, HTML documents must contain tags and set parameters. For an EMBED label, the settings (such as HEIGHT, WIDTH, QUALITY, and LOOP) enclosed in parentheses are all attributes of the label. For example:

The OBJECT tag has four settings (HEIGHT, WIDTH, CLASSID, and CODEBASE), which are their attributes. Other settings appear independently in HTML documents. They are called parameter tags. For example:


SRC
Value: Movie name (for example, moviename.swf ).
Corresponding template variable: $ MO
Function Description: Specifies the name of the video to be loaded. It is only applicable to the "EMBED" flag.

MOVIE
Value: Movie name (for example, moviename.swf ).
Corresponding template variable: $ MO
Function Description: Specifies the name of the video to be loaded. It is only applicable to the "OBJECT" flag.

CLASSID
Value: clsid: D27CDB6E-AE6D-11cf-96B8-444553540000
Function Description: Specifies the ActiveX control used by the browser. It must be identical to the preceding value and only applies to the "OBJECT" flag.

WIDTH
Value: number or percentage.
Corresponding template variable: $ WI.
Function Description: Specify the film width in the form of percentages of the number of bytes or the browser window width.

HEIGHT
Value: number or percentage.
Corresponding template variable: $ HE
Function Description: Specify the height of a video in the form of percentages of the number of bytes or the browser window height.

Because the Flash video can be scaled, changing the video width does not reduce the display quality of the video while maintaining the aspect ratio.

CODEBASE
Value: http://active.macromedia.com/flash4/cabs/swflash.cab
# Version = 4, 0, 0"

Function Description: Specifies the location of the ActiveX Control of Flash Player. When the browser does not install the control, it can be automatically downloaded to this location. The assigned value must be exactly the same as the above value. Only applicable to the "OBJECT" flag.

PLUGINSPAGE
Value: http://www.macromedia.com/shockwave/download/ index. cgi?
P1_Prod_Version = ShockwaveFlash
Function Description: specify the location of the Flash Player Plug-in for easy installation as needed. The assigned value must be exactly the same as the above value. Applies only to the "EMBED" flag.

SWLIVECONNECT (optional)
Value: true or false.
Function Description: determines whether to start Java when Flash Player is loaded for the first time. If this item is omitted, the default value is False. No matter when the same page contains JavaScript programs and Flash, to make the "FS Commands" statement take effect, you must run Java, however, if the JavaScript program on the page is only used to monitor the browser type or other functions unrelated to the "FS Commands" statement, you can set SWLIVECONNECT to false to prevent Java from being started, to start Java, You can explicitly set SWLIVECONNECT to true, which greatly increases the time the video starts playing. Applies only to the "EMBED" flag.

PLAY (optional)
Value: true or false.
Corresponding template variable: $ PL.
Function Description: used to specify whether to play a video immediately after the video is downloaded to the browser. If a video contains an interactive element, it may need to be played by the presenter. In this case, you can set this attribute to false to Prevent Automatic video playback, if this attribute is omitted, the default value is true.

LOOP (optional)
Value: true or false.
Corresponding template variable: $ LO.
Function Description: Specifies whether to play the video repeatedly or stop it after playing it again. If this attribute is omitted, the default value is true.

QUALITY (optional)
Values: low, high, autolow, autohig, or best.
Corresponding template variable: $ QU.
Function Description: see the preceding section.

If this attribute is omitted, it is executed based on the default value high.

BGCOLOR (optional)
Value: # RRGGBB (hexadecimal RGB value ).
Corresponding template variable: $ BG
Specifies the background color of the video. This attribute can replace the background color setting in the Flash video file, but does not affect the background color setting on the HTML page of the video.

SCALE (optional)
Valid values: showall, noborder, and exactfit.
Corresponding template variable: $ SC.
Function Description: When the width and height values are expressed as percentages, determine how the video is placed in a browser window. The options are as follows:

"Show all" (default value) shows the content of the entire video in the area of the specified size and maintains the same length/width ratio as the original video. The video content is not deformed.
"No Border" fills the specified area while maintaining the length/width ratio of the video. The video content is not deformed, but some content of the video may not be displayed.
"Exact Fit" makes the entire video visible in the specified area. Because the original length/width ratio is not maintained at this time, the video may be deformed.

When this attribute is omitted (and the width and height values are expressed as percentages), it is executed by the default value showall.

ALIGN
Values: L, R, T, and B.
Corresponding template variable: $ HA.
Function Description: sets the "ALIGN" attribute in the "OBJECT", "EMBED", and "IMG" labels to determine the position of the video in the browser window.

When this parameter is omitted, the video is placed in the center of the browser window. If the browser window size is smaller than the area occupied by the video, the browser window size is adjusted to make the video display normally.

The "L" value alignment the film to the left of the browser window. If the browser window is insufficient to accommodate the film, the upper and lower sides of the window and the right side of the window will be adjusted.
The "R" value alignment the film to the right of the browser window. If the browser window is insufficient to accommodate the film, the upper and lower sides of the window and the left side of the window will be adjusted.
The "T" value alignment the top side of the browser window. If the browser window is insufficient to accommodate the film, the left side and the bottom side of the window will be adjusted.
The "B" value alignment the bottom side of the video and the browser window. If the browser window is insufficient to accommodate the video, the left side and the top side of the window will be adjusted.

SALIGN (optional)
Values: L, R, T, B, TL, TR, BL, and BR.
Corresponding template variable: $ SA
Function Description: used to determine how a scaled video is placed in a scaled area with a fixed width and height. For the meanings of various values, see the previous item.

BASE (optional)
Value: Base path or URL.
Function Description: used to specify the reference position of the relative path used in the video.

MENU (optional)
Valid values: true and false.
Corresponding template variable: $ ME.
Function Description: specifies the type of shortcut menu that appears in the browser when you right-click the area occupied by the video (for Windows) or press the "command" key to click the mouse (for Macintosh.
The "True" value displays the entire menu, allowing the presenter to control the screening process in multiple ways.
The "False" value will display menus that only contain the "About Flash" menu item.

If this attribute is omitted, It is executed by default "true.

WMODE (optional)
Values: Window, Opaque, and Transparent.
Corresponding template variable: $ WM.
Function Description: this parameter is applicable only to Windows systems with Flash Active X space.

The "Window" value enables the video to play at the specified position on the webpage, which is also the fastest among several options.
The "Opaque Windowless" value blocks the content after the video on the webpage.
The "Transparent" value allows the Transparent part of the video on the webpage to display the content and background of the webpage, which may reduce the animation speed.

When this attribute is omitted, It will be executed by default "Window" and can only be used in the Object tag.

I. Introduction:

If we want to display the flash content normally on the webpage, the webpage must have a tag with the specified flash path. That is, the OBJECT and EMBED labels. The OBJECT tag is used for IE browsers on windows, and EMBED is used for Netscape Navigator browsers on windows and Macintosh platforms and IE browsers on Macintosh platforms. On windows, IE uses Activex controls to play flash, while other browsers use the Netscape plug-in technology to play flash.

The following is a simple example of code for inserting flash into a webpage:


The Code is as follows:


Codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH = "550" HEIGHT = "400" id = "myMovieName">



NAME = "myMovieName" ALIGN = "" TYPE = "application/x-shockwave-flash"
PLUGINSPAGE = "http://www.macromedia.com/go/getflashplayer">



2. Why should all the above labels be used? Can some labels be omitted?

The OBJECT tag is used in windows IE3.0 and later browsers or other browsers that support Activex controls. The "classid" and "codebase" attributes must be exactly written as shown in the preceding example. They tell the browser to automatically download the flash player address. If you have not installed flash player, then IE3.0 and later browsers will jump out of a prompt box to see if you want to automatically install flash player. Of course, if you do not want users who do not have flash player installed to automatically download the player, you may omit the code.

EMBED labels are used in Netscape Navigator2.0 and later browsers or other browsers that support the Netscape plug-in. The pluginspage attribute tells the browser the address for downloading the flash player. If flash player is not installed, restart the browser after installation.

To ensure that most browsers can normally display flash, you need to nest the EMBED tag in the OBJECT tag, just like the code example above. Browsers that support Activex controls will ignore the EMBED tag in the OBJECT tag. Netscape and IE browser using plug-ins will only read the EMBED tag, but will not recognize the OBJECT tag. That is to say, if you omit the EMBED tag, firefox will not be able to identify your flash (but it is puzzled that, If you omit the object, only embed will be written, and IE will be able to display the flash normally, take a closer look ).

The following lists the necessary and optional attributes of the OBJECT and EMBED labels used to publish a video.

1. required attributes:

· CLASSID-sets the Activex control of the browser, which is only used for OBJECT labels.

· CODEBASE-set the position of the flash Activex control. If the browser is not installed, it can be automatically downloaded and installed. Only used for OBJECT tags.

· WIDTH-specify the WIDTH of the flash video in percentages or pixels.

· HEIGHT-specify the HEIGHT of the flash video in percentages or pixels.

· SRC-specifies the video. Only for EMBED labels.

· PLUGINSPAGE-set the flash plug-in location. If the browser is not installed, it can be automatically downloaded and installed. Only for EMBED labels.

· MOVIE-specifies the video. Only used for OBJECT tags.

2. Optional attributes and available values:

· ID-set the variable name for reference of script code. Only for objects.

· NAME-set the variable NAME for reference of script code (such as javascript. EMBED only.

· SWLIVECONNECT-(true or false) Specifies whether to enable java when flash player is downloaded for the first time. If some attributes are omitted, the default value is false. If you use javascript and flash on the same page, java must use FSCommand to work.

· PLAY-(true or false) specifies whether the flash video is automatically played after the download is complete. If this attribute is omitted, the default value is true.

· LOOP-(true or false) Specifies whether to stop or continue LOOP playback after the last frame of the video is played. If this attribute is omitted, the default value is true.

· MENU-(true or false)

· True: displays all menus, allowing you to zoom in or zoom out to control video playback and other operations.

· False: only the set options and flash menus are displayed.

· QUALITY-(low, high, autolow, autohigh, best)

· Low is faster than beautiful and does not apply anti-sawtooth.

· Autolow focuses on speed at the beginning, but it can be improved at any time when needed.

· Autohigh focuses on both playback speed and aesthetic, but sacrifices the aesthetic to ensure playback speed when needed.

· Medium applies some anti-sawtooth bitmap without smoothing the bitmap. Its quality is higher than the low setting but lower than the high setting.

· High aesthetics is superior to playback speed, and anti-aliasing is always applied. If the video does not contain an animation, the bitmap will be smoothed; if the video contains an animation, the bitmap will not change.

· Best provides the Best display quality without considering the playback speed. All outputs apply anti-sawtooth and all bitmaps are smoothed.

· SCALE-(showall, noborder, exactfit)

· The Default (Show all) video is displayed in the specified area, but the original proportion is maintained. A border will appear on both sides of the video.

· No Boder compresses the film to fit the specified area and keeps the film undistorted. However, some films may be cropped. However, keep the original proportion of the video.

· Exact Fit enables the entire video to be displayed in the specified area. The film may be distorted without retaining the original proportion.

· ALIGN-(l, t, r, B)

· The default value is center. When the browser window is smaller than the video, the edge is cropped.

· Left, Right, Top, and Bottom are aligned along the edge of the browser according to the corresponding settings. If necessary, the other three sides will be cropped.

· SALIGN-(l, t, r, B, tl, tr, bl, br)

· L, R, T, B

· TL, TR

· BL, BR

· WMODE-(window, opaque, transparent) sets the window mode attribute of the flash video, specifying the transparency, stack, and position of the flash in the browser.

· Window Film is played in the browser's rectangular Window.

· The Opaque film hides all content behind it.

· Transparent makes the flash video Transparent and displays the webpage content behind the Transparent video. This will reduce the animation performance. This attribute is not available in all browsers.

· BGCOLOR-(# RRGGBB, hexadecimal RGB value .) Specifies the background color of the video. Use this property to overwrite the background color set in flash.

· BASE-sets the reference directory or URL to solve the relative path in flash. Similar Label.

· FLASHVARS transmits variables to flash player. flash player6 and later versions are required.

· Pass the root variable to the video. The string format is the name = value set separated.

· The browser supports 64 kB String Length.

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.