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 http://download.videolan.org/pub/videolan/debian woody main
     deb-src http://download.videolan.org/pub/videolan/debian 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 http://download.videolan.org/pub/videolan/debian sid main
     deb-src http://download.videolan.org/pub/videolan/debian 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.

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

<body>

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

<embed type="application/x-vlc-plugin"
         name="video1"
         autoplay="no" loop="yes" width="400" height="300"
         target="http://server.example.org/video1.vob" />
<br />
  <a href="javascript:;" onclick='document.video1.play()'>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>

</body>
</html>

Example

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

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

<body>

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

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

</body>
</html>