How to insert video using object and embed tags in html?

黄舟
Release: 2017-06-30 11:21:58
Original
3574 people have browsed it

1. Object

For object, w3c defines object as an embedded object. You can 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. The original intention of object was to replace the 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. And luckily, object Objects provide solutions. 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).

2. Object and embed

If we want to display the flash content normally in the 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 for 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 difference between and tags:
Both are objects used to play multimedia files, the object element is used for IE browsers, and the embed element is used for non-IE browsers , in order to ensure compatibility, usually we use two elements at the same time, and the browser will automatically ignore tags it does not support. When using two elements at the same time, the tag should be placed inside the tag.

The following is the code display

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="700" height="400">
	<param name="movie" value="How to insert video using object and embed tags in html?.swf" />
	<param name="quality" value="high" />
	<param name="allowFullScreen" value="true" />
	<param name="FlashVars" value="vcastr_file=12.flv&LogoText=description&BufferTime=3&IsAutoPlay=1">
	<embed src="How to insert video using object and embed tags in html?.swf" allowfullscreen="true" flashvars="vcastr_file=12.flv&IsAutoPlay=1&LogoUrl=images/logo.jpg" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="700" height="400"></embed>
</object>
Copy after login

After my own test, the flv or mp4 format can be played successfully

Player How to insert video using object and embed tags in html?.swfFile downloadAddress: How to insert video using object and embed tags in html?.swf

The following is the player style:

How to insert video using object and embed tags in html?

Attribute parameters

  • vcastr_file Method 2 passes the video flv file address parameter, use | to separate multiple spaces

  • vcastr_title Video title parameters, multiple use | separate, use empty with method 2

  • vcastr_xml Method 3 Pass the video flv file address parameter, for a sample, refer to vcastr .xml

  • IsAutoPlay Video auto-play parameters: 0 means not to play automatically, 1 means to play automatically 0

  • Is<a href="http://www.php.cn/wiki/131.html" target="_blank">Continue</a> Video continuous playback parameters: 0 means non-continuous playback, 1 means continuous loop playback 1

  • IsRandom Video Random play parameter: 0 means no random play, 1 means random play 0

  • DefaultVolume Default volume parameter: 0-100 value, set the default volume at the beginning of the video 100

  • Bar<a href="http://www.php.cn/wiki/902.html" target="_blank">Position</a> Control bar position parameter: 0 means floating display on the video, 1 means displaying 0

    below the video
  • IsShowBar Control bar display parameters: 0 means not displayed; 1 means always displayed; 2 means displayed when the mouse is hovering; 3 means not displayed at first and displayed after the mouse is hovered. 2

  • BarColor Playback control bar color, colors start with 0x and represent hexadecimal numbers 0×000033

  • BarTransparent Playback control bar transparency 60

  • GlowColor Key icon color, the color starts with 0x and is expressed as a hexadecimal number 0x66ff00

  • IconColor The halo color when the mouse is hovering. The color starts with 0x and is expressed as a hexadecimal number 0xFFFFFF

  • ##TextColor Player text color, the color starts with 0x and represents 0xFFFFFF as a hexadecimal number

  • LogoText You can add your own website name and other information (English) empty

  • LogoUrl You can read the logo image from the outside, be careful to adjust the logo size yourself, support image format and swf format empty

  • EndSwf After the video is played, the swf file is read from the outside. You can add relevant video information, video sharing and other information. You need to create the empty space yourself

  • BeginSwf Before the video starts playing, read the swf file from the outside. You can add advertisements or website information. You need to make your own space.

  • IsShowTime Whether to display the time: 0 means not to display the time, 1 means to display the time 1

  • BufferTime Video buffering time, unit (second) 2

The above is the detailed content of How to insert video using object and embed tags in html?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template