JavaScript DHTML/Development/PlugIn
Содержание
- 1 Accessing a Plug-In
- 2 A video of the planet yourWav
- 3 A video of the planet yourWav
- 3.1 Displaying a List of Navigator Plug-Ins
- 3.2 Displaying Plug-In Information
- 3.3 Display PDF using plugin
- 3.4 Find pluin for Midi
- 3.5 JavaScript to enumerate and display all installed plug-ins
- 3.6 Listing Plug-In Properties
- 3.7 Properties of the Plugin Object
- 3.8 Scan through each plug-in by provided parameters
- 3.9 Synchronizing Two Plug-Ins
- 4 The Planet yourWav
Accessing a Plug-In
<source lang="html4strict">
<HTML> <HEAD> <TITLE>Accessing Installed Plug-ins</TITLE> <SCRIPT LANGUAGE="JavaScript"></SCRIPT> </HEAD> <BODY>
A video of the planet yourWav
<SCRIPT LANGUAGE="JavaScript"></SCRIPT> <FORM> <INPUT TYPE="BUTTON" VALUE="Start" onClick="rewindVideo()"> <INPUT TYPE="BUTTON" VALUE="Play" onClick="playVideo()"> <INPUT TYPE="BUTTON" VALUE="Frame Forward" onClick="forward()"> <INPUT TYPE="BUTTON" VALUE="Frame Backward" onClick="back()"> <INPUT TYPE="BUTTON" VALUE="Stop" onClick="stopVideo()"> <INPUT TYPE="BUTTON" VALUE="End" onClick="forwardVideo()"> </FORM> </BODY> </HTML>
</source>
Determining Whether the LiveVideo Plug-In Is Installed
<source lang="html4strict">
<HTML> <HEAD> <TITLE>Detecting Installed Plug-ins</TITLE> </HEAD> <BODY>
A video of the planet yourWav
<SCRIPT LANGUAGE="JavaScript"></SCRIPT> </BODY> </HTML>
</source>
<source lang="html4strict">
<html> <head>
<script type="text/javascript"> </script>
</head> <body>
<form> <input type="button" value="Show Plug-In Information" onclick="showWindow()"> </form>
</body> </html>
</source>
Displaying Plug-In Information
<source lang="html4strict">
<HTML> <HEAD> <TITLE>Determining Installed Plug-ins</TITLE> </HEAD> <BODY> <SCRIPT LANGUAGE="JavaScript"></SCRIPT> </BODY> </HTML>
</source>
Display PDF using plugin
<source lang="html4strict">
<html> <head> <script language="JavaScript">
</script> </head> </html>
</source>
Find pluin for Midi
<source lang="html4strict">
<html> <head> <script language="JavaScript">
</script> </head> </html>
</source>
JavaScript to enumerate and display all installed plug-ins
<source lang="html4strict">
<HTML> <HEAD> <TITLE>About Plug-ins</TITLE> </HEAD> <BODY> <SCRIPT language="javascript"> numPlugins = navigator.plugins.length; if (numPlugins > 0)
document.writeln("Installed plug-ins");
else
document.writeln("No plug-ins are installed.");
for (i = 0; i < numPlugins; i++) {
plugin = navigator.plugins[i];document.write("
document.write(plugin.name);document.writeln("
"); document.writeln("
- ");
document.writeln("
- File name:");
document.write(plugin.filename);
document.write("
"); document.write(plugin.description); document.writeln("
"); document.writeln("
Mime Type | "); document.writeln("Description | "); document.writeln("Suffixes | "); document.writeln("Enabled | "); document.writeln("
---|---|---|---|
");
document.write(mimetype.type);document.writeln(" | ");
document.writeln("");
document.write(mimetype.description);document.writeln(" | ");
document.writeln("");
document.write(mimetype.suffixes);document.writeln(" | ");
document.writeln("");
document.writeln(enabled);document.writeln(" | ");
document.writeln("
} </SCRIPT> </BODY> </HTML>
</source>
Listing Plug-In Properties
<source lang="html4strict">
<HTML>
<HEAD>
<TITLE>Listing the properties of a plug-in</TITLE>
<SCRIPT LANGUAGE="JavaScript"></SCRIPT>
</HEAD>
<BODY>
<EMBED SRC="yourfile.avi">
<SCRIPT LANGUAGE="JavaScript"></SCRIPT>
</BODY>
</HTML>
</source>
Properties of the Plugin Object
<source lang="html4strict">
Property Description description Contains the description of the plug-in. filename Contains the filename of a plug-in program. length Contains the number of MIME types supported by the plug-in. name Contains the name of the plug-in. </source>
Scan through each plug-in by provided parameters
<source lang="html4strict">
<html> <head> <script language="JavaScript">
</script> </head> </html>
</source>
Synchronizing Two Plug-Ins
<source lang="html4strict">
<HTML> <HEAD> <TITLE>Synchronizing Plug-ins</TITLE> <SCRIPT LANGUAGE="JavaScript"></SCRIPT> </HEAD> <BODY onLoad="start()">
The Planet yourWav
<EMBED SRC="yourfile.avi" NAME="video" AUTOSTART="TRUE"
WIDTH="350" HEIGHT="240">
<EMBED SRC="yourfile.wav" HIDDEN="TRUE"> <FORM> <INPUT TYPE="BUTTON" VALUE="Start" onClick="start()"> <INPUT TYPE="BUTTON" VALUE="Play" onClick="play()"> <INPUT TYPE="BUTTON" VALUE="Pause" onClick="stop()"> <INPUT TYPE="BUTTON" VALUE=" End " onClick="end()"> </FORM> </BODY> </HTML>
</source>