Grow your CSS skills. Land your dream job.

Hacking Some JS

  • # May 3, 2012 at 8:43 pm

    So, I’m using Jilion’s Sublime’s HTML5 Video Player on my site. And was wondering if there was a way to use some jQuery to animate my video player when certain events are triggered via the player?

    For example when the play button is hit, the video player would shift into the center of the screen.

    I had a dig around in the js for the player and it seems to be using things like “play”, “pause”, “finish” and “end” to trigger what the player does. What I was wondering is if I could that same technique as some jQuery that would say do this when “play” is hit:

    $('#video').animate({left: '350'}, "fast");

    I understand this is sort of a hack job, could anyone point me in the direction of how I’d go about doing something like this.

    Here’s an example of the play function:

    o.play=function(a){if(a||this.ga==Dc)this.Z=0,this.coords=this.ec;else
    if(this.Ga())return l;Ic(this);this.startTime=a=oa();-1==this.ga&&(this.startTime-
    =this.duration*this.Z);this.ue=this.startTime+this.duration;this.rd=this.startTime;
    this.Z||this.vd();this.la("play");-1==this.ga&&this.la("resume");this.ga=1;
    var b=ia(this);b in Gc||(Gc=this);Jc();Lc(this,a);return j};

    Thanks in advance for any help whatsoever.

    # May 3, 2012 at 10:34 pm

    well, I would think that what you posted would work but it looks like you need to use play instead of #video. So look for the onlclick events in jquery and bind it to the play. In the code, it looks like this

    this.la(“play”);

    that’s what I would try

    # May 3, 2012 at 10:45 pm

    @cybershot So would something like this work?

    $('this.la("play")').toggle(function(){
    $('#video').animate({left: '-90'}, "fast");
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".