Browser Plug-in API: About Plug-ins

A plug-in is an add-on program that extends the capabilities of a browser. For example, plug-ins can enable users to view pdf files and flash files, or to play audiotapes or movies on a browser.

The Browser Plug-in API enables developers to create plug-ins that can do the following:

HTML Tags Used to Display Plug-ins

HTML tags determine the way a plug-in is displayed on a Web page. The following HTML tags invoke the plug-in and determine its display mode:

About the Object Tag

The object tag specifies the attributes of an object, such as a plug-in, to be embedded in a Web page to be viewed with the browser. An example of an object tag is as follows:

<object
    data="dataLocation"
    type="MIMEType"
    align="alignment" 
    height="pixHeight" 
    width="pixWidth"
    id="name"
>
    <param name="name1" value="value1" />
    <param name="name2" value="value2" />
</object>

where:

data is the location of the object's data This is a mandatory attribute.
type is the MIME type of the plug-in This is a mandatory attribute.
align is the left, right, top, or bottom alignment of the plug-in on the HTML page This is an optional attribute.
height is the vertical size, in pixels, of the plug-in on the HTML page This is an optional attribute.
width is the horizontal size, in pixels, of the plug-in on the HTML page This is an optional attribute.
id is the name of the plug-in This is an optional attribute.
param name is the name of a parameter required by the plug-in This is an optional attribute.
value is the initial value of the parameter required by the plug-in This is an optional attribute.

About the Embed Tag

The embed tag specifies the attributes of a plug-in to be embedded in a Web page to be viewed with the browser. An example of an embed tag is as follows:

<embed 
    src="location"
    type="MIMEtype"
    align="left"|"right"|"top"|"bottom"
    border="borderWidth" 
    frameborder="no"  
    height="height"
    width="width"
    units="units"
    hspace="horizMargin" 
    vspace="vertMargin" 
    id="name"
    name1="value1"
	 name2="value2"
	
>
</embed>

where:

src is the URL location of the file to run This is a mandatory attribute.
type is the MIME type of the plug-in needed to run the file This is a mandatory attribute.
align is the left, right, top, or bottom alignment of the plug-in on the HTML page This is an optional attribute.
border is the width, in pixels, of the border surrounding the plug-in on the HTML page This creates a picture frame effect. This is an optional attribute.
frameborder

specifies whether or not the frames on the HTML page appear with borders separating themselves from each other Values: yes or no This is an optional attribute.

height is the vertical size of the plug-in on the HTML page Default unit: pixels This is an optional attribute.
width is the horizontal size of the plug-in on the HTML page Default unit: pixels This is an optional attribute.
units is the unit used for the sizes of the height and width For example: inches, cm, mm, point size, or pixels. This is an optional attribute.
hspace is the width, in pixels, of an invisible border to the left and right of the plug-in on the HTML page This creates blank space on the left and right sides of the plug-in object. This is an optional attribute.
vspace is the width, in pixels, of an invisible border above and below the plug-in on the HTML page This creates blank space above and below the plug-in object. This is an optional attribute.
id is the name of the plug-in This is an optional attribute.

An embed tag must contain either the src attribute or the type attribute in order for the plug-in to load. The browser uses either the value of the type attribute or the suffix of the file name of the source to determine which plug-in to use. For example:

<embed src="doh.wav" width="100" height="40" type="audio/wav">
</embed>

Browser Plug-in API Utilities

The Browser Plug-in API is compatible with the S60 platform.

The Utilities class of the Browser Plug-in API provides developers with the capability to program and compile their plug-ins once for the S60 platform.

Plug-in developers must link their plug-ins with the PluginAdapterUtil.dll dynamic-link Library (DLL). Call the ExtractParentControlAndApiL function to get the parent window.

The Browser Plug-in API consists of the following two parts:

ECom

The EPOC Component Object Model (ECom) provides a means to improve S60 platform security and reduce browser startup time. When the browser starts up, it queries the ECom framework to get a list of all plug-ins whose UIDs are registered with Symbian. Unlike earlier versions of the browser, the browser for S60 3 rd Edition does not have to search all directories to find dynamic link library (DLL) files for the appropriate plug-in to render a particular MIME type. Instead, the new browser gets a list of Symbian-approved plug-in applications.

A plug-in system contains fours clearly-defined roles:

S60 uses ECOM to decouple a reusable module interface from its implementation(s). Therefore, in order to implement an ECOM object, an interface and one or more implementations must exist or be created. ECOM has all of the runtime advantages of polymorphic DLLs for implementing a specified interface. Unlike polymorphic DLLs, ECom contains a generic framework that provides a single mechanism for all clients to discover and instantiate the appropriate implementation.

An ECOM implementation is associated with its interface by means of a resource file that contains information such as the following:

A sample resource file may be found in Example 1 on page 16.

Additional Information About Plug-in Development

For information about plug-in development, including links to a variety of plug-in sources, see Reference 2 on page 63.

For information about ECom, see Reference 5 on page 63.


Copyright © Nokia Corporation 2001-2008
Back to top