revolunet, conseil NTIC intranet internet  

VLCobject : embed VLC in your webpages

Introduction

VLCobject.js is a small javascript library inspired from swfobject that detects and embeds the VLC plugin in your webpage. It works With Internet Explorer, Firefox and Opera Browsers.

The code is still experimental and needs many improvements, feel free to send us your suggestions and corrections at contact@revolunet.com. With your help, we could make VLC plugin become more popular !

If you want to add controls to your VLCobject, you can add the VLCcontrols library.

The code is under BSD, so you can redistribute it and/or modify it under the terms of the BSD License.

Any sugestions or questions are welcome on our email : contact@revolunet.com

We hope this script will make VLC browser plugin more popular hence improving VLC plugin penetration over the web.

Enjoy ;)

Features list

Easy to use
Display a link to download the plugin if needed
Tested on Internet Explorer 6, Firefox 2, Opera, Safari (XP)

Examples :

Simple example, just loads a VLC player :
<script type="text/javascript" src="VLCobject.js"></script> <div id="vlccontent"> This text is replaced by the VLC player. </div> <script type="text/javascript"> var myvlc = new VLCObject("mymovie", "400", "200", "0.8.6"); myvlc.write("vlccontent"); </script>

This example can be viewed here

another example, the file is play automatically :
<script type="text/javascript" src="VLCobject.js"></script> <div id="vlccontent"> This text is replaced by the VLC player. </div> <script type="text/javascript"> var myvlc = new VLCObject("mymovie", "400", "200", "0.8.6"); myvlc.addParam("MRL","http://code.revolunet.com/VLCjs/rambo.mpg"); myvlc.write("vlccontent"); </script>

This example can be viewed here

Todo :

There's many things still to do with this code, we're workin on, and we need your help :

  • . cleaning & optimisation
  • . Multiples player per page support
  • . Automatic activex/mozilla plugin detection & installation

    Licence :

    The code is under BSD, so you can redistribute it and/or modify it under the terms of the BSD License.

    Download

  • javascript source
  • CHANGELOG

  • 25.1.2008 : first release
  • 10.4.2008 : improved compatibility with VLC thanx to thannoy

    Commentaires