[Live-devel] OT: AMINO STB JS for displaying graphic when using trick functions

rcourtney at iowadsl.net rcourtney at iowadsl.net
Wed Jan 24 11:44:06 PST 2007


For those that have been playing with trick functions (FF REW PAUSE STOP)
here is the Javascript I have been playing with.

Build your graphic as a 640x500 PNG with a green background (00ff00).
Where the background is green will be transparent. IM me if you need
a sample emailed.

When you press a trick key the trkbkg.png graphic will be shown overlayed
onto the video. You will note that the first time PAUSE is pressed it will
be very faint. The Amino units allow alpha blending.

<HTML>
<HEAD><TITLE>Amino JS Page</TITLE>
<aminoattr tcr="#00ff00" UNLOADVIDEO="no" notoolbar hidepointer />

<script language="javascript">

var Blank = 0; // Flag indicating overlay is blacked out
TimePauseLastPressed = 0;
PauseDebounceTime = 750; // 0.75 seconds

function keyAction(e) {
var keypressed = e.which;
switch(keypressed)
{
case 1073742136: // Pause
Now = new Date();
if Now.getTime()>(TimePauseLastPressed+PauseDebounceTime)) {
TimePauseLastPressed=Now.getTime();
if (Blank==0) {
VideoDisplay.SetAlphaLevel(0);
Blank=1;
}
else
{
VideoDisplay.SetAlphaLevel(75);
Blank=0;
}
}
break;
case 1073742131: // Play
VideoDisplay.SetAlphaLevel(0);
Blank=1;
break;
case 1073742132: // FF
VideoDisplay.SetAlphaLevel(100);
break;
case 1073742134: // Rewind
VideoDisplay.SetAlphaLevel(100);
break;
case 1073742133: // Stop
VideoDisplay.SetAlphaLevel(30);
break;
default:
//window.alert("unhandled key press: "+keypressed);
break;
}
}
</script>

</HEAD>
<BODY bgcolor="#00ff00" text="#ffffff" background="trkbkg.png"
style="background-repeat:
no-repeat" onkeypress="keyAction(event);" >
<amino fgalpha="5">
<script language="javascript">
VideoDisplay.SetAlphaLevel(0);
Blank=1;
AVMedia.Play('type=VOD;src=rtsp://ServerIP/test.ts;servertype=ncube;offset=69;');
</script>
</BODY>
</html>



More information about the live-devel mailing list