VLCcontrols : intégrez VLC et ses controles dans vos pages web

Introduction

VLCcontrols.js est une librairie additionelle à VLCobject qui ajoute quelques controles au plugin VLC standard comme play, stop, volume, barre de défilement...

VLCcontrols propose une API simplifiée et cross browser pour controler votre plugin VLC

Pour un fonctionnement optimal, vous devez avoir VLC version 0.9.8 ou superieure;

Code sous licence BSD, modifiable sous les terme de la BSD License. Il est hebergé chet github : http://github.com/revolunet/VLCcontrols

Ce code est encore experimental, suggestions bienvenues sur contact@revolunet.com.

Notre but avec cette librairie et d'améliorer la presence de VLC sur le web. Aidez nous !

> Exemple complet avec gestion des sous-titres, transcoding/streaming, enregistrement en local... advanced example

Features

Facile à utiliser
Seekbar incluse avec notre
SimpleSlider.js javascript slider library
Testé sur Internet Explorer 6, Firefox 2, Opera, Safari (XP)
Mini API pour controller le plugin
Gestion des options de VLC

API :

var controls = new VLCcontrols(vlcobject); wraps controls to an existing VLCobject
controls.options.set("start-time", 50); set a VLC option; here the media will start at 50secs. see VLC options wiki
controls.options.set("directx-wallpaper"); set a VLC option; here the directx wallpaper output will be actived see VLC options wiki
controls.options.clear(); reset all VLC options
controls.play(uri); launch the movie in the plugin
controls.stop(); stop playing the movie

Exemples :

usage : extract the zip contents somewhere on your site directory

Charges simplement le plugin à l'aide de
VLCobject puis ajoute les controles de base :
    <script type="text/javascript" src="VLCobject.js"></script>
    <script type="text/javascript" src="VLCcontrols.js"></script>
            
    <div id="vlccontent">
      This text is replaced by the VLC player.
    </div>

    <script type="text/javascript">
        var vlc_controls = null;
        function init() {
            // load basic VLCobject
            var vlcobject = new VLCObject("mymovie", "400", "200", "0.8.6");
            vlcobject.write("vlccontent");
            // add controls
            vlc_controls = new VLCcontrols(vlcobject, true);
            }
        window.onload = init();
    </script>
> exemple visible ici

2eme exemple, ici le fichier est lancé automatiquement au démarrage :
    <script type="text/javascript" src="VLCobject.js"></script>
    <script type="text/javascript" src="VLCcontrols.js"></script>
            
    <div id="vlccontent">
      This text is replaced by the VLC player.
    </div>

    <script type="text/javascript">
        var vlc_controls = null;
        function init() {
            // load basic VLCobject
            var vlcobject = new VLCObject("mymovie", "400", "200", "0.8.6");
            vlcobject.write("vlccontent");
            // add controls
            vlc_controls = new VLCcontrols(vlcobject);
            
            //start playing when ready
                vlc_controls.onready = function () {
                    vlc_controls.play("http://code.revolunet.com/VLCjs/rambo.mpg");
                }
            }
        window.onload = init();
    </script>
> exemple visible ici

3eme exemple, ici le fichier est lancé automatiquement au démarrage et des options sont passées au plugin VLC :)
    <script type="text/javascript" src="VLCobject.js"></script>
    <script type="text/javascript" src="VLCcontrols.js"></script>
            
    <div id="vlccontent">
      This text is replaced by the VLC player.
    </div>

    <script type="text/javascript">
        var vlc_controls = null;
        function init() {
            // load basic VLCobject
            var vlcobject = new VLCObject("mymovie", "400", "200", "0.8.6");
            vlcobject.write("vlccontent");
            // add controls
            vlc_controls = new VLCcontrols(vlcobject);
            vlc_controls.options.set("start-time", "60");
            vlc_controls.options.set("directx-wallpaper");
            //start playing when ready
                vlc_controls.onready = function () {
                    vlc_controls.play("http://code.revolunet.com/VLCjs/rambo.mpg");
                }
            }
        window.onload = init();
    </script>
> exemple visible ici

> Exemple complet avec gestion des sous-titres, transcoding/streaming, enregistrement en local... advanced example

Todo :

  • cleaning & optimisation
  • Support de plusieurs lecteurs par page
  • Visualisations pour l'audio

    Licence :

    Code sous licence BSD, reditribuable sous BSD License.

    Download

  • Récupérez le projet sur http://github.com/revolunet/VLCcontrols
  • Change log

  • 28.01.2008 : first release, merged from some code
  • 07.04.2008 : added VLC options managements + some corrections
  • 10.04.2008 : improved compatibility with VLC thanx to thannoy
  • 23.04.2008 : added subtitles, transcoding/streaming capabilities
  • 23.07.2008 : auto stop the player when starting a new item
  • 15.02.2009 : added transparent images (thanx to LScube project) and fixed vlc api internal playlist bug
  • 07.09.2009 : some corrections for VLC >= 1.9
  • 08.09.2009 : Moved to github

    Who use it ?

  • Indira Gandi National Open University
  • StackMedia
  • Australian National University
  • PiipTv Media Portal for Nokia
  • LScube open source streaming solution
  • Commentaires

    site réalisé et hébergé par revolunet © 2009 - informations légales