Video media playback, the best way to solve HTML

Source: Internet
Author: User

The best way to solve HTML

HTML 5 + <object> + <embed>

<video width= "height=" controls= "Controls" >  <source src= "Movie.mp4" type= "Video/mp4"/>  <source src= "Movie.ogg" type= "Video/ogg"/>  <source src= "MOVIE.WEBM" type= "VIDEO/WEBM"/>  <object data= "Movie.mp4" width= "on" "height=" > <embed src= "    movie.swf" width= "" "Height="/> "  </object></video>
The code above comes from W3cschool
The object tag only supports IE series browsers or other browsers that support ActiveX controls (Internet Explorer)

To make sure that most browsers display flash correctly, you need to nest the embed tag inside the OBJECT tag.

-----In short, IE can recognize embed, but in order to let other browsers also recognize, plus object.

Most of us now do Web pages, are directly using DW to insert Flash, and DW is WYSIWYG, directly generated the corresponding flash display code. But how many of us are aware of the code generated directly by DW? Actually I contact Flash Player tag, is in just learning HTML, when the book inserted flash only the simplest <embed src= "" Width= "" height= "" ></embed> a sentence, And in a long period of time, as long as the page inserted flash I also wrote this, at that time, think, so write is simple and easy to remember, and save code, instead of the DW question, why so simple code, it to make so complex it. But if you think about it, the code generated by DW must have his reasons. And in the later application, also should testify my judgment (hehe, perhaps the idea originally is the dish).
Over the past few weeks, I have been working on flash with JS and. NET interactive applications, so I have a deeper understanding of object and embed tags. Just these two days, in doing Flash implementation page drag block layout function (like QQ space JS layout), due to different users, load and output different user profiles, so I thought of by. NET generated by the corresponding user's profile name, and with <param name= "Flashvars" value= "Import=userimport1.txt&output=useroutput1.txt" > To pass the relevant file variables to flash. However, in practical applications, browsers such as Firefox and Opera are found not to be able to change such variables, rather, they do not support <param> tags. So today time, on the MM net collection integrated a bit of relevant content.

First, Introduction:
We want to display the Flash content normally in the webpage, then must have the label of the specified flash path in the page. That is, the object and embed tags. The object tag is for the Windows platform of IE browser, and embed is used for Windows and Macintosh platform under the Netscape Navigator browser and the Macintosh platform under IE browser. The Windows platform's IE uses ActiveX controls to play Flash while other browsers use the Netscape plug-in technology to play flash.

Here is a sample code for inserting flash in a simple Web page:

Code:

<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= "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>

Second, why use all the above label? Can I omit some tags?
The object tag is used for Windows IE3.0 and later browsers or other browsers that support ActiveX controls. The "ClassID" and "codebase" properties must be written exactly as shown in the example above, which tells the browser to automatically download the address of the Flash Player. If you have not installed Flash Player then the IE3.0 browser will jump out of a box to access whether or not you want to install Flash Player automatically. Of course, if you don't want users who don't have Flash Player installed to download the player automatically, maybe you can omit the code.

The embed tag is used for Netscape Navigator2.0 and later browsers or other browsers that support Netscape plugins. The "pluginspage" property tells the browser to download the address of Flash Player, and if you do not have Flash Player installed, you will need to restart your browser to use it.
To make sure that most browsers display flash correctly, 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 the IE browser using the plugin will read only the embed tag without recognizing the OBJECT tag. In other words, if you omit the embed tag, then Firefox will not recognize your flash (but it is puzzling that the omitted object only write Embed,ie can also display the flash, hehe, specific and then carefully see).
This article lists the necessary and optional properties for the object and embed tags that are used to publish the movie.

First, required attributes:
· CLASSID
-Set the browser's ActiveX control for the OBJECT tag only.
· CODEBASE-Set the location of the Flash ActiveX control, so if the browser is not installed, you can download the installation automatically. Only for object tags.
· WIDTH-Specify the width of the flash movie in percent or pixels.
· HEIGHT-Specify the height of the flash movie in percent or pixels.
· SRC-Specify the movie's. For embed labels only.
· Pluginspage-Set the location of the Flash plugin, so if the browser is not installed, you can download the installation automatically. For embed labels only.
· MOVIE-Specify the movie's. Only for object tags.

second, optional attributes and available values:
ID
-Set the variable name for the reference to the script code. For object only.
datastore-Set the variable name for a reference to the script code (such as JavaScript). For embed only.
· Swliveconnect-(TRUE or FALSE) Specifies whether Java is enabled when Flash Player downloads for the first time. If some attributes are omitted, the default value is False. You must use Fscommand to work with JavaScript and Flash,java on the same page.
· PLAY-(TRUE or FALSE) specifies whether the Flash movie will play automatically after the download is complete, or true if this attribute is omitted.
· LOOP-(TRUE or FALSE) specifies whether to stop or resume looping after the last frame of the movie is played, or true if this attribute is omitted.
· MENU-(True or false)
· True displays all menus, allowing users to zoom in, zoom out, and so on to control movie playback and other actions.
· False displays only the settings options and the menu about flash.
· Quality-(Low, High, Autolow, Autohigh, best)
· The low speed is superior to aesthetics and does not apply anti-aliasing.
· Autolow is just beginning to focus on speed, but when needed, it improves aesthetics at any time.
· Autohigh at the same time focus on the playback speed and aesthetics, but the need to sacrifice beauty to ensure the playback speed.
· Medium applies some anti-aliasing instead of smoothing bitmaps. It is higher quality than the low setting and below the high setting.
· High aesthetics is better than playback speed, and anti-aliasing has been applied. If the movie does not contain animations, the bitmap is smoothed, and if the movie contains animations, the bitmap will not be smoothed.
· Best provides the highest display quality without regard to playback speed. All outputs have anti-aliasing applied and all bitmaps are smoothed.
· Scale-(ShowAll, Noborder, Exactfit)
· The Default show all movie is displayed within the specified area, but the original scale is maintained. A border will appear on both sides of the movie.
· No boder shrinks the movie to fit the specified area, keeping the movie not distorted, but some of the videos will probably be cropped. Keep the original proportions of the film however.
· Exact Fit causes the entire movie to be displayed in the specified area, and the movie is likely to distort and not maintain the original proportions.
· ALIGN-(L, T, R, B)
• The default is centered, and the edges are cropped when the browser window is smaller than the movie.
· The Left,right,top,bottom is 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 property of the Flash movie, specifying the transparency, stacking, and placement of flash in the browser.
· The window movie plays within its own rectangular window in the browser.
· The Opaque movie hides all the content behind it.
· Transparent makes flash movies transparent, showing the contents of pages behind transparent movies. This will degrade the performance of the animation. And 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-Set the base directory or URL to resolve the relative path in Flash. Similar to <base> tags in web pages.
· FlashvarsPassing variables to Flash Player requires Flash PLAYER6 and later versions.
• Pass the root level variable to the movie. The format of the string is the Name=value set separated by "&".
• The browser supports 64kB size string lengths.
• For more information about Flashvars, please see the documentation.


Video media playback, the best way to solve HTML

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.