HTML Plug-Ins


The function of the plug-in is to extend the function of the HTML browser.


HTML Helpers (Plug-Ins)

A helper application is a program that can be launched by a browser. Auxiliary applications are also called plug-ins.

Auxiliary programs can be used to play audio and video (among others). The auxiliary program is loaded using the <object> tag.

One advantage of using auxiliary programs to play video and audio is that you can allow users to control some or all of the playback settings.

Plugins can be added to the page via the <object> tag or the <embed> tag. 

Most auxiliary applications allow manual (or programmatic) control of volume settings and playback functions (such as rewind, pause, stop, and playback).

Notice:

Most browsers no longer support Java applets and plug-ins.

Most modern browsers have turned off support for Flash.

The following examples of swf files will not work properly in modern browsers.

NoteWe can use <video> and <audio> tags to display video and audio

<object> Element

All major browsers support the <object> tag.

The <object> element defines the object embedded in the HTML document.

This tag is used to insert objects (such as embedding Java applets in web pages, PDF readers, Flash players).

Example

<object width="400" height="50" data="bookmark.swf"></object>

Try It!

The <object> element can also be used to contain HTML files:

Example

<object width="100%" height="500px" data="snippet.html"></object>

Try It!

Or insert a picture:

Example

<object data="demos/tutorialfish-logo.png"></object>

Try It!


<embed> Element

All major browsers support the <embed> element.

The <embed> element represents an HTML Embed object.

The <embed> element has been around for a long time, but it was not explained in detail before HTML5. This element will be validated on HTML 5 pages, but not on HTML 4.

Example

<embed width="400" height="50" src="bookmark.swf">

Try It! 

NoteNote that the <embed> element does not have a closing tag. Alternative text cannot be used.

The <embed> element can also be used to include HTML files:

Example

<embed width="100%" height="500px" src="snippet.html">

Try It! 

Or insert a picture:

Example

<embed src="demos/tutorialfish-logo.png">

 Try It!