1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Guys, does this even exist?

Discussion in 'PHP & Perl' started by dating101, Jan 5, 2011.

  1. dating101

    dating101 Regular Member

    Joined:
    Aug 6, 2008
    Messages:
    440
    Likes Received:
    310
    Occupation:
    Out of work Construction Superintendent. Local rea
    I am looking for a script that will autoplay a video at a specific time.... whether someone is on the page or not.

    I am not looking for an autoplay function.

    Example..... I want a video to start playing at 6 pm Arizona time with no user controls available (start, pause, time of video, etc....)

    Does this exist, or do I need someone to code it for me?

    Thanks!!!!!
     
  2. Debian

    Debian Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 17, 2009
    Messages:
    714
    Likes Received:
    282
    Occupation:
    Residential Proxies & VPN's
    Home Page:
    You want it to play whether no one is watching it or not? Whats the benefit then?
     
    • Thanks Thanks x 1
  3. c0ntenth|ef

    c0ntenth|ef Power Member

    Joined:
    May 20, 2009
    Messages:
    788
    Likes Received:
    118
    Location:
    california
    it can be easily done with actionscript but i am not an actionscript coder:p
     
    • Thanks Thanks x 1
  4. dating101

    dating101 Regular Member

    Joined:
    Aug 6, 2008
    Messages:
    440
    Likes Received:
    310
    Occupation:
    Out of work Construction Superintendent. Local rea
    It's for a test and feasibilty study on an idea I have.
     
  5. dating101

    dating101 Regular Member

    Joined:
    Aug 6, 2008
    Messages:
    440
    Likes Received:
    310
    Occupation:
    Out of work Construction Superintendent. Local rea
    Gonna check it out. Thanks bro
     
  6. reptile

    reptile Registered Member

    Joined:
    Oct 19, 2009
    Messages:
    93
    Likes Received:
    13
    if i understand you right you want something like what leo laporte does on http://live.twit.tv. When he is doing a show it is live, but when he isn't he has scheudled "reruns" of his stuff. He can easily schedule something for a specific time.

    so... i know its possible, just not sure the best way to do it.
     
    • Thanks Thanks x 1
  7. tacopalypse

    tacopalypse Executive VIP Jr. VIP Premium Member

    Joined:
    Nov 30, 2009
    Messages:
    980
    Likes Received:
    2,485
    Home Page:
    well here's a really simple way to do it:

    put the video on a separate page. have some javascript on the main page which repeatedly checks what time it is. when it hits 6pm, create an iframe going to the page that the video is on.
     
    • Thanks Thanks x 1
  8. dating101

    dating101 Regular Member

    Joined:
    Aug 6, 2008
    Messages:
    440
    Likes Received:
    310
    Occupation:
    Out of work Construction Superintendent. Local rea
    Yes, that is pretty much what I am looking for, but having a hell-of-a time finding someone that understands what it is I am looking for. Now I have a source for someone to check out. Thanks for the link.

    But was hoping that someone here had a script laying around that would do that too.
     
  9. dating101

    dating101 Regular Member

    Joined:
    Aug 6, 2008
    Messages:
    440
    Likes Received:
    310
    Occupation:
    Out of work Construction Superintendent. Local rea
    That.... actually... is a good idea. Thanks!
     
  10. chrisis4ever

    chrisis4ever Regular Member

    Joined:
    Jul 10, 2008
    Messages:
    240
    Likes Received:
    73
    Occupation:
    Musician/Marketer/Graphic Designer
    Location:
    Shaker Heights Ohio
    you can also use
    HTML:
    http://ustream.com
    it is actually more popular
     
    • Thanks Thanks x 1
  11. 00CivicEX

    00CivicEX Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 3, 2009
    Messages:
    293
    Likes Received:
    214
    PHP:
    function CheckTime($currentTime$startTime$endTime){    //    // the time passed must meet all the below criteria to return 1 (true):    //    // - current hour needs to be equal or greater than start hour    // - current hour needs to be equal or less than end hour    // - current minute needs to be equal or greater than start minute (if current hour is ok)    // - current minute needs to be equal or less than end minute (if current hour is ok)    //    // if any of those checks does not pass, it will return 0 (false)    global $cHour;    global $cMin;    global $sHour;    global $sMin;    global $eHour;    global $eMin;    // break up current time    $now = explode(":",$currentTime);    $cHour = intval($now[0]);    // current time - hour    $cMin = intval($now[1]);    // current time - minute    // break up start time    $start = explode(":",$startTime);    $sHour = intval($start[0]);    // start of range - hour    $sMin = intval($start[1]);    // start of range - minute    // brek up end time    $end = explode(":",$endTime);    $eHour = intval($end[0]);    // end of range - hour    $eMin = intval($end[1]);    // end of range - minute    // this is the variable used to track the result of the checks    $pass = true;    if($sHour <= $eHour){        // the range is on the same day        // compare to the start hour        if($cHour < $sHour){            $pass = false;        };        // compare to the end hour        if($cHour > $eHour){            $pass = false;        };        // compare to the start min        if($cHour == $sHour){            if($cMin < $sMin){                $pass = false;            };        };        // compare to the end min        if($cHour == $eHour){            if($cMin > $eMin){                $pass = false;            };        };    } else {        // the range is overnight, so the logic is a little different        if( ($cHour < $sHour) && ($cHour > $eHour) ){            $pass = false;        };        // compare to the start min        if($cHour == $sHour){            if($cMin < $sMin){                $pass = false;            };        };        // compare to the end min        if($cHour == $eHour){            if($cMin > $eMin){                $pass = false;            };        };    };    // done with check, return the result    if($pass == false){        return 0;    // failed    } else {        return 1;    // passed    };};// test it out// make sure you use military time// usage: current time, range start time, range end timeecho CheckTime("06:30","15:20","06:45");    // this should return 1

    This code will check to see if the time is in a certain range. You can then use javascript or something to play the video.
     
    • Thanks Thanks x 1
  12. dating101

    dating101 Regular Member

    Joined:
    Aug 6, 2008
    Messages:
    440
    Likes Received:
    310
    Occupation:
    Out of work Construction Superintendent. Local rea
    Good stuff! Thank you!