Guys, does this even exist?

dating101

Regular Member
Joined
Aug 6, 2008
Messages
440
Reaction score
317
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!!!!!
 
You want it to play whether no one is watching it or not? Whats the benefit then?
 
You want it to play whether no one is watching it or not? Whats the benefit then?

It's for a test and feasibilty study on an idea I have.
 
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.
 
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.
 
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.

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.
 
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.

That.... actually... is a good idea. Thanks!
 
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.
 
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.

Good stuff! Thank you!
 
Back
Top