Definition and Usage Define an embedded object. Please use this element to add multimedia to your XHTML pages. This element allows you to specify data and parameters for objects inserted into an HTML document, as well as code that can be used to display and manipulate the data. The
tag is used to contain objects such as images, audio, video, Java applets, ActiveX, PDF, and Flash. object was originally intended to replace img and applet elements. However, this did not happen due to bugs and lack of browser support. The browser's object support depends on the object type. Unfortunately, major browsers all use different code to load the same object types. Fortunately, object provides a solution. If the object element is not shown, the code between and is executed. This way we can nest multiple object elements (one for each browser). Use OBJECT and EMBED tags In order to play Flash movies in the browser, the HTML document must contain the and tags, and set parameters. For the EMBED tag, the settings enclosed in parentheses (such as HEIGHT, WIDTH, QUALITY and LOOP, etc.) are its attributes, for example: The OBJECT tag has 4 settings (HEIGHT, WIDTH, CLASSID and CODEBASE), which are all its attributes. Other settings appear independently in the HTML document and are called parameter tags. For example: < PARAM NAME="LOOP" VALUE="true"> SRC Get Value: movie name (such as movieName.swf). Corresponding template variable: $MO Function description: Specify the name of the video to be loaded, only applicable to the "EMBED" flag. MOVIE Value: movie name (such as movieName.swf). Corresponding template variable: $MO Function description: Specify the name of the video to be loaded, only applicable to the "OBJECT" mark. CLASSID Value: clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 Function description: Specify the ActiveX control used by the browser, which must be exactly the same as the above value Same, only available in the "OBJECT" flag. WIDTH Value: number or percentage. Corresponding template variable: $WI. Function description: Specify the width of the video in the form of pixels or a percentage of the browser window width. HEIGHT Value: number or percentage. Corresponding template variable: $HE Function description: Specify the height of the video in the form of a number of pixels or a percentage of the browser window height. Because Flash videos are scalable, changing the size of the video format while maintaining the aspect ratio will not degrade the display quality of the video. CODEBASE Value: http://active.macromedia.com/flash4/cabs/swflash.cab #version=4,0,0,0" Function description: Indicate the location of the Flash player's ActiveX control. When the browser does not install it, it can be automatically downloaded to this location. The value assigned must be exactly the same as the above value. Only applicable to ". OBJECT" mark. PLUGINSPAGE Value: http://www.macromedia.com/shockwave/download/ index.cgi? P1_Prod_Version=ShockwaveFlash Function description: Indicates the location of the Flash player plug-in to facilitate installation when needed. The value assigned must be exactly the same as the value above. Applies only to the "EMBED" flag ( Optional) Value: true or false. Function description: Used to determine whether to start Java when the Flash player is loaded for the first time. When this item is omitted, the default value is False. Whenever a JavaScript program and Flash are included in the same page, Java must be running in order for the "FS Commands" statement to work. However, if the JavaScript program in the page is only used to detect the type of browser or other issues related to "FS Commands" " statement has nothing to do with the function, you can set SWLIVECONNECT to false to prevent Java from starting. To start Java, you can explicitly set SWLIVECONNECT to true, which will greatly increase the time it takes for the video to start playing. Only applicable to "EMBED" ” sign. PLAY (optional) Value: true or false. Corresponding template variable: $PL. Function description: Used to specify whether to immediately after the video is downloaded to the browser Play. If the video contains interactive elements, it may require relevant operations from the presenter to start playback. In this case, you can set this attribute to false to prevent the video from automatically playing. When this attribute is omitted, the default value of true will be used. LOOP (optional) Value: true or false. Corresponding template variable: $LO. Function description: Specify whether the video should be played repeatedly or stopped after playing once. When this attribute is omitted, the default value of true will be used. QUALITY (optional) Values: low, high, autolow, autohig or best. Corresponding template variable: $QU. Function description: See above. When this attribute is omitted, the default value of high will be executed. BGCOLOR (optional) Value: #RRGGBB (hexadecimal RGB value). Corresponding template variable: $BG Specify 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 of the HTML page where the video is located. SCALE (optional) Values: showall, noborder, exactfit. Corresponding template variable: $SC. Function description: When width and height When the value is expressed as a percentage, determines how the video is placed in the browser window. The options are as follows: "Show all" (default value) displays the entire video content in the specified size area and maintains the same aspect ratio as the original video, and the video content is not deformed. "No Border" fills the specified area while maintaining the aspect ratio of the video. The video content will not be deformed, but part of the video content may not be displayed. "Exact Fit" makes the entire video visible in the specified area. Because the original aspect ratio is no longer maintained at this time, the video may be deformed. When this attribute is omitted (and the width and height values are expressed as percentages), the default value of showall will be executed. ALIGN Values: L, R, T, B. Corresponding template variable: $HA. Function description: Set "OBJECT", " EMBED" and "ALIGN" attributes in the "IMG" tag determine the position of the movie in the browser window. When omitted, the video will be 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 will be adjusted so that the video can be displayed normally. The "L" value aligns the video to the left side of the browser window. If the browser window is not large enough to accommodate the video, the top, bottom and right edges of the window will be adjusted. The "R" value aligns the video to the right side of the browser window, and if the browser window is not large enough to accommodate the video, the top, bottom, and left edges of the window will be adjusted. The "T" value aligns the video with the top edge of the browser window, and if the browser window is not large enough to accommodate the video, the left, right, and bottom edges of the window will be adjusted. The "B" value aligns the video with the bottom edge of the browser window, and if the browser window is not large enough to accommodate the video, the left, right, and top edges of the window will be adjusted. SALIGN (optional) Values: L, R, T, B, TL, TR, BL, BR. Corresponding template variable: $SA Function description: Used to determine how the scaled video is placed in an area with specified width and height. The meaning of various values can be found in 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) Values: true, false. Corresponding template variable: $ME. Function description: Used to specify in the browser The type of shortcut menu that appears when you right-click (Windows) or command-click (Macintosh) an area of a movie. A "True" value will display the entire menu, allowing the person being presented with a variety of controls over the screening process. A value of "False" will display a menu containing only the "About Flash" menu item. When this attribute is omitted, the default value "true" will be used. WMODE (optional) Values: Window, Opaque, Transparent. Corresponding template variable: $WM. Function description: This parameter is only available in Applicable to Windows systems with Flash Active X space. The "Window" value causes the video to be played at the specified location on the web page. This is also the fastest playback speed among several options. The "Opaque Windowless" value will block content behind the video on the web page. The "Transparent" value causes the transparent portion of the video on the web page to display the content and background of the web page, potentially slowing down the animation. When this attribute is omitted, it will be executed with the default value "Window" and can only be used in Object tags. 1. Introduction: If we want to display flash content normally in a web page, there must be a tag specifying the flash path in the page. That is, the OBJECT and EMBED tags. The OBJECT tag is used for the IE browser on the Windows platform, while EMBED is used on the Netscape Navigator browser under the Windows and Macintosh platforms and the IE browser under the Macintosh platform. IE on the windows platform uses Activex controls to play flash, while other browsers use Netscape plug-in technology to play flash. The following is a simple code example for inserting flash into a web page:
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 use all the above tags? Can some tags be omitted? 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 written exactly as shown in the above example. They tell the browser the address to automatically download the flash player. If you have not installed flash player, browsers after IE3.0 will pop up a prompt box asking whether you want to automatically install flash player. Of course, if you don't want users who don't have flash player installed to automatically download the player, maybe you can omit these codes. EMBED tag is used in Netscape Navigator 2.0 and later browsers or other browsers that support Netscape plug-ins. The "pluginspage" attribute tells the browser the address to download the flash player. If the flash player has not been installed, the user needs to restart the browser after installation to use it normally. In order to ensure that most browsers can display flash normally, you need to nest the EMBED tag within the OBJECT tag, just like the above code example. Browsers that support Activex controls will ignore the EMBED tag within the OBJECT tag. Netscape and IE browsers using plug-ins will only read the EMBED tag and will not recognize the OBJECT tag. In other words, if you omit the EMBED tag, then Firefox will not be able to recognize your flash (but what is surprising is that if you omit object and only write embed, IE can display flash normally, haha, let’s take a closer look) . Listed below are the required and optional attributes of the OBJECT and EMBED tags used to publish videos. 1. Required attributes: ·CLASSID - Sets the browser's Activex control, only used for OBJECT tags. ·CODEBASE-Set the location of the flash Activex control, so that 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 percentage or pixels. ·HEIGHT-Specify the height of the flash video in percentage or pixels. ·SRC-Specify the download address of the video. Only for EMBED tags. ·PLUGINSPAGE-Set the location of the flash plug-in, so that if the browser does not have it installed, it can be automatically downloaded and installed. Only for EMBED tags. ·MOVIE-Specify the download address of the video. Only used for OBJECT tags. 2. Optional attributes and available values: ·ID - Set variable name, used for reference in script code. For OBJECT only. ·NAME - Set the variable name for reference in script code (such as javascript). For EMBED only. ·SWLIVECONNECT - (true or false) specifies whether to enable java when the flash player is first downloaded. If these 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 movie will automatically play after the download is completed. If this attribute is omitted, the default is true. ·LOOP - (true or false) specifies whether to stop or continue looping after the last frame of the video. If this attribute is omitted, it defaults to true. ·MENU - (true or false) ·True displays all menus, allowing users to zoom in, zoom out, etc. to control video playback and other operations. ·False displays a menu that only contains setting options and about flash. ·QUALITY - (low, high, autolow, autohigh, best) ·Low is faster than beautiful and does not apply anti-aliasing. ·Autolow starts with a focus on speed, but always improves aesthetics when needed. ·Autohigh focuses on both playback speed and aesthetics, but sacrifices aesthetics to ensure playback speed when necessary. ·Medium applies some anti-aliasing without smoothing the bitmap. Its quality is higher than the low setting and lower than the high setting. ·High Beauty is better than playback speed, and anti-aliasing is always applied. If the movie does not contain animation, the bitmap will be smoothed; if the movie contains animation, the bitmap will not be smoothed. ·Best provides the best display quality regardless of playback speed. All output has anti-aliasing applied and all bitmaps smoothed. ·SCALE - (showall, noborder, exactfit) ·Default (Show all) The video is displayed in the specified area but maintains the original proportion. Borders will appear on both sides of the video. ·No Boder shrinks the video to fit the specified area, keeping the video undistorted, but part of the video may be cropped. However the original proportions of the film are maintained. ·Exact Fit causes the entire video to be displayed within a specified area. The video may be deformed and distorted, and the original proportions may not be maintained. ·ALIGN - (l, t, r, b) ·The default is centered. When the browser window is smaller than the video, the edges will be cropped. ·Left, Right, Top, Bottom are aligned along the edge of the browser according to the corresponding settings. If necessary, the other three sides will be trimmed. ·SALIGN - (l, t, r, b, tl, tr, bl, br) ·L,R,T,B ·TL,TR ·BL,BR ·WMODE- (window, opaque, transparent) Set the window mode attribute of the flash movie and specify the transparency, cascading and position of the flash in the browser. ·Window The video plays in its own rectangular window in the browser. ·Opaque video hides everything behind it. ·Transparent makes the flash video transparent and displays the web content behind the transparent video. This will reduce animation performance. And this property is not available in all browsers. ·BGCOLOR - (#RRGGBB, hexadecimal RGB value.) Specifies the background color of the video. Use this attribute to override the background color set in flash. ·BASE - Set the base directory or URL to resolve all relative paths in flash. Similar to the tag in web pages. ·FLASHVARS transfers variables to flash player, which requires flash player 6 and later versions. ·Pass root-level variables to the video. The format of the string is a name=value set separated by "&". ·Browser supports 64kB string length.