Home >Web Front-end >HTML Tutorial >Introduction to the difference between html tag object and embed

Introduction to the difference between html tag object and embed

黄舟
黄舟Original
2017-06-30 11:14:471867browse

object defines 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.

273238ce9338fbb04bee6997e5552b95 tag is used to contain objects such as images, audio, video, Java applets, ActiveX, PDF, and Flash. The
embed tag defines embedded content, such as plug-ins.

The difference between object and embed:
1. In order to be compatible with different browsers, IE only supports the parsing of Object; Firefox, Google, and Safari only support the parsing of Embed.
2. The object tag uses clsid to represent the unique id of the control, and the embed tag uses type
to represent the unique name of the plug-in. For example, the flash plug-in type is: application/x-shockwave-flash, and the mp3 playback plug-in type is audio/mpeg.
3. In order to be compatible with multiple browsers, you can dynamically load the Object tag through ie browser, and dynamically load the embed tag through non-ie browsers; or embed embed in the object tag. Label.

Simple example of flash
The following is a simple code example for inserting flash into a web page:
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="http://www.doflash.net/"/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>

Use object and embed tags to Embedding, if you are careful, you will find that many parameters of object and many attributes of embed are repeated. Why do you do this? For browser compatibility, some browsers support object and some support embed. This is why both places must be changed when modifying Flash parameters. This method has always been the official method of Macromedia, ensuring the functionality of Flash to the greatest extent without compatibility issues.
At this stage, embedding Flash with JS is the most perfect method. Someone has written a very complete embedding script that can be easily downloaded and used (SWFObject is recommended), SWFObject.js download addresshttps:/ /github.com/swfobject/swfobject

objec parameter description
The param name tag is some functions and playback parameters embedded in this playback plug-in, such as (you can copy it down):

<param name="playcount" value="1">
<!--控制重复次数: “x”为几重复播放几次; x=0,无限循环。--> 
<param name="autostart" value="0">
<!--控制播放方式: x=1,打开网页自动播放; x=0,按播放键播放。--> 
<param name="clicktoplay" value="1">
<!--控制播放开关: x=1,可鼠标点击控制播放或暂停状态; x=0,禁用此功能。--> 
<param name="displaysize" value="0">
<!--控制播放画面: x=0,原始大小; x=1,一半大小; x=2,2倍大小。--> 
<param name="enablefullscreen controls" value="1">
<!--控制切换全屏: x=1,允许切换为全屏; x=0,禁用此功能。--> 
<param name="showaudio controls" value="1">
<!--控制音量: x=1,允许调节音量; x=0,禁止音量调节。--> 
<param name="enablecontext menu" value="1">
<!--控制快捷菜单: x=1,允许使用右键菜单; x=0,禁用右键菜单。--> 
<param name="showdisplay" value="1">
<!--控制版权信息: x=1,显示电影及作者信息;x=0,不显示相关信息--> 
<param NAME="AutoStart" VALUE="-1">
<!--是否自动播放--> 
<param NAME="Balance" VALUE="0">
<!--调整左右声道平衡,同上面旧播放器代码--> 
<param name="enabled" value="-1">
<!--播放器是否可人为控制--> 
<param NAME="EnableContextMenu" VALUE="-1">
<!--是否启用上下文菜单--> 
<param NAME="url" VALUE="http://1.wma"> <!--播放的文件地址-->
<param NAME="PlayCount" VALUE="1"><!--播放次数控制,为整数--> 
<param name="rate" value="1">
<!--播放速率控制,1为正常,允许小数,1.0-2.0--> 
<param name="currentPosition" value="0">
<!--控件设置:当前位置--> 
<param name="currentMarker" value="0">
<!--控件设置:当前标记--> 
<param name="defaultFrame" value="">
<!--显示默认框架--> 
<param name="invokeURLs" value="0">
<!--脚本命令设置:是否调用URL--> 
<param name="baseURL" value="">
<!--脚本命令设置:被调用的URL--> 
<param name="stretchToFit" value="0">
<!--是否按比例伸展--> 
<param name="volume" value="50">
<!--默认声音大小0%-100%,50则为50%--> 
<param name="mute" value="0">
<!--是否静音-- 
<param name="uiMode" value="mini">
<!--播放器显示模式:Full显示全部;mini最简化;None不显示播放控制,只显示视频窗口;invisible全部不显示--><param name="windowlessVideo" value="0">
<!--如果是0可以允许全屏,否则只能在窗口中查看--> 
<param name="fullScreen" value="0">
<!--开始播放是否自动全屏--> 
<param name="enableErrorDialogs" value="-1">
<!--是否启用错误提示报告--> 
<param name="SAMIStyle" value>
<!--SAMI样式--> 
<param name="SAMIFilename" value>
<!--字幕ID-->

The above is the detailed content of Introduction to the difference between html tag object and embed. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn