I need a script that can play video in a certain time.

Discussion in 'PHP' started by dimitrisk5, Feb 24, 2010.

  1. #1
    Hello,

    I need a script that will be programed to play a video in my server in a certain time. E.g. I upload the video sample.flv to my server - www.example.com/sample.flv and I want this video start playing at Monday 28 February 2010 10:00 AM but none can pause or stop the video, like a webtv.

    If someone know one script that could do this job or can write one, please reply here :)

    PS. Sorry for my poor english :D
     
    dimitrisk5, Feb 24, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    You can do an if statement and check the current time with your defined time, then echo a player containing the video.
     
    danx10, Feb 24, 2010 IP
  3. dimitrisk5

    dimitrisk5 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I dont understand that.
     
    dimitrisk5, Feb 24, 2010 IP
  4. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #4
    there are lots of free players for videos, google it...
    your main problem here is setting the date of playing dynamically...
    retrieve the date then do an if else statement whether to play it or not..
     
    bartolay13, Feb 25, 2010 IP
  5. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #5
    <?php
    
    $defined_time = "25 February 2010 03:26 PM";
    
    if(date("d/m/Y h:i A", time()) == date("d/m/Y h:i A", strtotime($defined_time))){
    
    //insert an embed code for your player...
    echo "Play the player...";
    
    } else {
    
    echo "Streaming is not available yet!";
    }
    
    ?>
    PHP:
     
    danx10, Feb 25, 2010 IP
  6. dimitrisk5

    dimitrisk5 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks Danx10, I will test it tomorrow :):)
     
    dimitrisk5, Feb 25, 2010 IP