Introduction to the difference between OBJECT and EMBED tags used to display flash content

Introduction to the difference between OBJECT and EMBED tags used to display flash content
1. Introduction:

If we want to display flash content normally on the web page, there must be a tag that specifies the flash path on the page. That is, the OBJECT and EMBED tags. The OBJECT tag is used for the Internet Explorer browser on the Windows platform, while the EMBED tag is used for the Netscape Navigator browser on the Windows and Macintosh platforms and the Internet Explorer browser on the Macintosh platform. IE on Windows platform uses ActiveX control to play Flash while other browsers use Netscape plug-in technology to play Flash.

The following is a code example of inserting Flash into a simple web page:

Code:

Copy code
The code is as follows:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="550" HEIGHT="400" id="myMovieName">
<PARAM NAME=movie VALUE="myFlashMovie.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="/support/flash/ts/documents/myFlashMovie.swf" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400"
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>

2. Why use all the above tags? Can some tags 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 written exactly as shown in the example above. They tell the browser where to automatically download the flash player. If you have not installed Flash Player, then IE3.0 or later browsers 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, you can probably omit these codes.
The EMBED tag is used in Netscape Navigator 2.0 and later browsers or other browsers that support the Netscape plug-in. The "pluginspage" attribute tells the browser where to download the flash player. If the flash player has not been installed, the user needs to restart the browser after installation before it can be used normally.
To ensure that most browsers can display flash normally, you need to nest the EMBED tag inside the OBJECT tag, as shown in the code example above. 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. That is to say, if you omit the EMBED tag, Firefox will not be able to recognize your flash (but the puzzling thing is that if you omit the object and only write embed, IE can also display the flash normally, haha, let's take a closer look at the details).

The following list contains the required and optional attributes of the OBJECT and EMBED tags used to publish movies.

1. Required attributes:

CLASSID-Set the browser's ActiveX control, only used for OBJECT tags.
CODEBASE - sets the location of the Flash ActiveX control so that it can be automatically downloaded and installed if the browser does not have it installed. Only used for OBJECT tags.
WIDTH - specifies the width of the flash movie in percentage or pixels.
HEIGHT - specifies the height of the flash movie in percentage or pixels.
SRC - specifies the download address of the video. For use with the EMBED tag only.
PLUGINSPAGE - sets the location of the flash plugin so that it can be automatically downloaded and installed if the browser does not have it installed. For use with the EMBED tag only.
·MOVIE-Specify the download address of the movie. Only used for OBJECT tags.

2. Optional attributes and available values:

ID-Sets the variable name for reference in script code. Only for OBJECT.
NAME - sets the variable name, which is used to reference script code (such as javascript). For EMBED only.
·SWLIVECONNECT - (true or false) Specifies whether Java should be enabled when Flash Player is first downloaded. If these properties 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 should automatically play after downloading. If this attribute is omitted, it defaults to true.
LOOP - (true or false) Specifies whether the movie should stop or continue looping after the last frame. If this property is omitted, it defaults to true.
MENU - (true or false)
True displays the full menu, allowing the user to zoom in, zoom out, and control video playback.
False Displays a menu containing only setup options and flash information.
QUALITY - (low, high, autolow, autohigh, best)
Low Favors speed over aesthetics, and no anti-aliasing is applied.
Autolow focuses on speed initially, but is always ready to improve beauty when needed.
Autohigh focuses on both playback speed and aesthetics, but sacrifices aesthetics to ensure playback speed when necessary.
Medium applies some antialiasing without smoothing the bitmap. It is higher quality than the low setting and lower quality than the high setting.
High takes precedence over playback speed, and anti-aliasing is always applied. If the movie contains no animation, the bitmap is smoothed; if the movie contains animation, the bitmap remains unsmoothed.
Best provides the best display quality regardless of playback speed. All output has anti-aliasing applied and all bitmaps are smoothed.
SCALE - (showall, noborder, exactfit)
Default (Show all) The movie is displayed in the specified area, but the original proportions are maintained. Borders will appear on both sides of the video.
No Border shrinks the video to fit the specified area, keeping the video intact, but part of the video may be cropped. Yet keeping the original proportions of the film.
Exact Fit makes the entire video appear in the specified area. The video may be distorted and not keep the original proportions.
ALIGN - (l, t, r, b)
The default is to center the video. 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 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 movie, specifying the transparency, layering and position of the flash in the browser.
Window The movie plays in its own rectangular window in the browser.
Opaque The video hides everything behind it.
·Transparent makes the flash movie transparent, showing the web page content behind the transparent movie. This will reduce the performance of the animation. Also, this property is not available in all browsers.
BGCOLOR - (#RRGGBB, hexadecimal RGB value.) Specifies the background color of the movie. Use this property to override the background color set in Flash.
BASE - Sets the base directory or URL used to resolve all relative paths in flash. Similar to the <base> tag in a web page.
·FLASHVARS passes variables to Flash Player, requires Flash Player 6 or later.
Pass root level variables to the movie. The format of the string is a name=value set separated by "&".
The browser supports a string length of 64kB.

<<:  Negative distance (empathy) - iterative process of mutual influence

>>:  CSS3 sets a mask for the background image and solves the problem of mask style inheritance

Recommend

Why Seconds_Behind_Master is still 0 when MySQL synchronization delay occurs

Table of contents Problem Description Principle A...

JavaScript implements mouse control of free moving window

This article shares the specific code of JavaScri...

Tutorial on upgrading from Centos7 to Centos8 (with pictures and text)

If you upgrade in a formal environment, please ba...

How to develop Java 8 Spring Boot applications in Docker

In this article, I will show you how to develop a...

One sql statement completes MySQL deduplication and keeps one

A few days ago, when I was working on a requireme...

How to use CocosCreator to create a shooting game

Analyze the production steps: 1. Prepare resource...

Ubuntu 20.04 Chinese input method installation steps

This article installs Google Input Method. In fac...

Analysis and solution of a.getAttribute(href,2) problem in IE6/7

Brief description <br />In IE6 and 7, in a ...

Html sample code for reading and displaying pictures in a local folder

One purpose Select a local folder on the Html pag...

How to use dl(dt,dd), ul(li), ol(li) in HTML

HTML <dl> Tag #Definition and Usage The <...

SQL implementation of LeetCode (177. Nth highest salary)

[LeetCode] 177.Nth Highest Salary Write a SQL que...

Analysis of the difference between emits and attrs in Vue3

Table of contents in conclusion Practice Analysis...

Graphic tutorial on configuring log server in Linux

Preface This article mainly introduces the releva...