SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Nov 2011
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cool Closing a video in (prettyphoto) lightbox, on a timer? Looking for simple javascript.

    Hey everybody, I had a code I found on google a few weeks ago that did this function well, but as I redesigned a few parts I deleted the code, and I cannot find it again :\

    The one thing I didn't like about the code was that the timer was not set in minuets or seconds it was set in hundreds ex. 800 would be equivalent to IDK I would have to guess and it wasn't very accurate.

    Ex. of the lightbox and video to give you a better picture can be found here: www.VisumDesignz.com the second slideshow image has a play button on it click that and the video will appear in a prettyphoto lightbox.

    I am sure you guys know a code for this by heart or you are better at keyword searches than me because I cannot find it on google

    Thanks in advance.

  2. #2
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think its set to millisecond so 800 means 8 seconds.

  3. #3
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    776
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by GenevieveToyd View Post
    i think its set to millisecond so 800 means 8 seconds.
    It would be 0.8 seconds

    Visumdesignz: AFAIK all timing functions in javascript are done in Milliseconds

    With regards to closing the lightbox when the video finishes playing, the optimal solution would be achieved if the videoplayer would allow you to register a callback so that it can run some JavaScript once it finishes.

    (One player that I regularly use, JW Player, has functionality like this built in, perhaps your player has something similar?)
    var details = {
    . . web: "afterlight.com.au",
    . . photos: "jvdl.id.au",
    . . psa: "usethelatestversion.com"
    }

  4. #4
    SitePoint Member
    Join Date
    Nov 2011
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AussieJohn View Post
    It would be 0.8 seconds

    Visumdesignz: AFAIK all timing functions in javascript are done in Milliseconds

    With regards to closing the lightbox when the video finishes playing, the optimal solution would be achieved if the videoplayer would allow you to register a callback so that it can run some JavaScript once it finishes.

    (One player that I regularly use, JW Player, has functionality like this built in, perhaps your player has something similar?)

    I am not even using a player, it's just a .swf file I styled the light box to fit around the .swf. I think I should get some type of player though.

  5. #5
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    776
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    If you made the flash file yourself, you could use an ExternalInterface.call to call some JS on your page, that will allow you know when it's finished playing and close the lightbox.

    Assuming you're using ActionScript3, you could do something along these lines:

    Code Actionscript:
    //call this when your video/flash/animation finishes
    ExternalInterface.call("playbackFinished");

    With the following JavaScript:
    Code JavaScript:
    function playbackFinished() {
        //do your magic in here
    }
    var details = {
    . . web: "afterlight.com.au",
    . . photos: "jvdl.id.au",
    . . psa: "usethelatestversion.com"
    }


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •