Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
YUI for vlc
JavaScript
branch: master

This branch is 30 commits ahead of kvzhuang:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.md
sample.html
vlc.html
vlc.js

README.md

VLC with YUI plugin

We design this utility to help some VLC web plugin's leak. The player's state change detection. The old version crash issue (still improve). The browser's compatibility (IE, FireFox and Chrome should work).

How to use.

  1. First thing, you might include YUI 3 seed in your html file and this vlc.js.
<script type="text/javascript" src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
<script type="text/javascript" src="vlc.js"></script>
  1. Use this vlc plugin by the following code.

     YUI().use("vlc","node-event-delegate", function (Y) {});
    
  2. Create variable and its config.

     var vlc, config;
         config = {
             "container": "#vlc",
             "url": "http://dl.dropbox.com/u/10258402/GokKUqLcvD8.mp4"
         };
         vlc = new Y.VLC(config);
    
  3. Config has many setting attributes (still in developing).

    container : You can settup where your vlc plugin to show.
    url       : The streaming url you will play.
    autoPlay  : Will vlc player autoplay this streaming?
    size      : Array to control vlc player's width and height,
                [0] is width, [1] is height.
    
  4. You also can access some attributes by using YUI ATTRS access method. Just access like sample code: vlc.get("installed");

    installed  : Is your browser install vlc web plugin?
    state      : The state of current vlc player state
                ("idle", "opening", "buffering", "playing", "paused",
                 "stopped", "ended", "error")
    positin    : The video current playing time.
    duration   : The video total playing length.
    volume     : The volume setting (0-200)
    size       : The player's width and height (using array).
    fullscrren : Set player fullscreen.
    
  5. State detection - thank god the YUI ATTR has change event, even origin vlc web plugin state change event is not working. We can still detect its state.

     vlc.on("buffering", function(e){ //when player is buffering
        Y.log("VLC buffering");
    });
    vlc.on("ready", function(e){    //when player is ready
        Y.log("VLC ready");
    });
    //When vlc is playing, e.duration and e.postion can be access
    //for timeline purpose.
    vlc.on("playing", function(e){
        Y.log("playing - duration = " + e.duration + "/ position = " + e.position);
    });
    //When vlc state change, YUI can detech the state change event.
    vlc.after("stateChange", function(e){
        Y.log("State change from "+e.prevVal +" to "+e.newVal );
    });
    
  6. Some issue The autoPlay attribute still has some problems, we are trying to figure it out.
Something went wrong with that request. Please try again.