Chapter 7.  The Mozilla plugin

Table of Contents

Install the plugin
Build HTML pages that use the plugin

VLC can also be embedded in a web browser ! For the moment, this function is only available with Mozilla under GNU/Linux. An experimental plugin is also available for Mac OS X and Microsft Windows.

Install the plugin

GNU/Linux Debian

You should already have the following lines in your /etc/apt/sources.list file, if you run Debian Woody:

     deb woody main
     deb-src woody main

VLC's latest packaged version is always in the official Debian unstable branch. However you should still use our apt-get line if you need libdvdcss in its latest version:

     deb sid main
     deb-src sid main

Install the mozilla-plugin-vlc package:

# apt-get update
# apt-get install mozilla-plugin-vlc

Compile the sources yourself

Install the Mozilla development package (mozilla-dev under Debian).

Install the required librairies like for a normal VLC install (from the sources, or from the packages with the development packages).

Download the sources of the latest release: get the file vlc-version.tar.gz from the VLC sources download page. Uncompress-it, configure-it, compile and install:

% tar xvzf vlc-version.tar.gz
% cd vlc-version
% ./configure --enable-mozilla
% make
% su
Password:  [Root Password]
# make install

Build HTML pages that use the plugin

Here are a few examples of HTML pages that use the Mozilla plugin.

Example 1

In this example, the plugin will read an HTTP stream inside the web page. If the user goes fullscreen, he will have to press f to go back in normal view.

<head><title>Demo of VLC mozilla plugin</title></head>


<h1>Demo of VLC mozilla plugin - Example 1</h1>

<embed type="application/x-vlc-plugin"
         autoplay="no" loop="yes" width="400" height="300"
         target="" />
<br />
  <a href="javascript:;" onclick=''>Play video1</a>
  <a href="javascript:;" onclick='document.video1.pause()'>Pause video1</a>
  <a href="javascript:;" onclick='document.video1.stop()'>Stop video1</a>
  <a href="javascript:;" onclick='document.video1.fullscreen()'>Fullscreen</a>



In this example, the plugin will read a multicast UDP stream in a dedicated video output window.

<head><title>Demo of VLC mozilla plugin</title></head>


<h1>Demo of VLC mozilla plugin - Example 2</h1>

<embed type="application/x-vlc-plugin"
         autoplay="no" loop="no" hidden="yes"
         target="udp:@" />
<br />
  <a href="javascript:;" onclick=''>Play video2</a>
  <a href="javascript:;" onclick='document.video2.stop()'>Stop video2</a>
  <a href="javascript:;" onclick='document.video2.fullscreen()'>Fullscreen</a>