CodesCompiler
πŸ”
HTMLCSSJavaScriptPythonSQLPHPSEOPostsBooksKids About Contact πŸš€ Get Started Free

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