PDA

View Full Version : How Do I make A Time Based T.V. Show?



paagle
12-20-2005, 11:31 AM
I Have A local channel and I am Planning to use java to make it perfect.I want to make framed web pageto show on t.v. as the channel shows my desk top on the screen and also the sound playing on my comp.
What I need is a time based script which runs according to the time on my computer like say its 2 o'clock and I want to play a movie at that time with real player so what script do i use to do so?
I want something that will automatically play a preset audio or video or swf file at a specific time.
Thanx in advance

jscheuer1
12-20-2005, 04:29 PM
If you already have it worked out how to beam your desktop into millions of homes across our nation or the planet or just a few in your neighborhood, and you are leaving the computer on all the time with the browser showing a local page and you know how to launch a movie onclick on the page, the rest should be rather simple. Polling is the term for the concept you can use. A simple poll for this could be:


<script type="text/javascript">
function checkTime (hour){
var now=new Date()
if (now.getHours()==hour){
do whatever to launch the movie
clearInterval(movieTime)
}
}
var movieTime=setInterval("checkTime(14);", 1*1000*60)
</script>

14 is 2:00pm in 24hr notation. 1*1000*60 is 1 minute in milliseconds, in this case how often to check to see if the time is right.

paagle
12-21-2005, 04:42 AM
I need A complete script that will automatically play different things at different preset times and I beam across a few in the neighbourhood.
Plz Give me full ideas as I am really new to scripts I am doing it on t.v. and t.v. in India doesnt allow clicking .

jscheuer1
12-21-2005, 06:55 AM
Yes TV here doesn't allow clicking either, if it isn't WEBtv. However, if you have another page that launches the movie, you can have something like this in the body of the first page:


<a id="movie" href="movie.htm" onclick="window.location.replace(this.href)">Movie</a>

Then using the script that I already gave you:


<script type="text/javascript">
function checkTime (hour){
var now=new Date()
if (now.getHours()==hour){
document.getElementById('movie').onclick();
clearInterval(movieTime)
}
}
var movieTime=setInterval("checkTime(14);", 1*1000*60)
</script>

And then for the next movie page, put the code for that on movie.htm. If, on the other hand, it is simply a case of whatever is on your screen is on the TV station, you might want to investigate scheduler programs. There are a number of freeware ones out there. With one of those, you would not need the browser or javascript at all and could launch your programs that show your content directly as well as automatically.

No Nags (http://nonags.com/) is a good international resource for freeware.