JavaScript - Multimedia
JavaScript - Multimedia
The JavaScriptnavigatorobject includes a child object calledplugins. This object is an array, with one entry for each plug-in installed on the browser. The navigator.plugins object is supported only by Netscape, Firefox, and Mozilla only.
Example
Here is an example that shows how to list down all the plug-on installed in your browser β
Preview
Checking for Plug-Ins
Each plug-in has an entry in the array. Each entry has the following properties β
- nameβ is the name of the plug-in.
- filenameβ is the executable file that was loaded to install the plug-in.
- descriptionβ is a description of the plug-in, supplied by the developer.
- mimeTypesβ is an array with one entry for each MIME type supported by the plug-in.
You can use these properties in a script to find out the installed plug-ins, and then using JavaScript, you can play appropriate multimedia file. Take a look at the following example.
Preview
NOTEβ Here we are using HTML <embed> tag to embed a multimedia file.
Controlling Multimedia
Let us take one real example which works in almost all the browsers β
Preview