CODE
float sectime = 0;
default
{
state_entry()
{
llSetText("Almighty Cube of Synchronization \n (touch to sync video)",<1,1,1>,1);
llSetTimerEvent(5.0);
}
timer()
{
float sectime2 = sectime+5;
sectime = sectime2;
if(sectime2 <= 3687)
{
integer temptime2 = llRound((sectime2 / 3687) * 100);
integer temptime3 = llRound((3687 - sectime2)/ 60);
llSetText("Almighty Cube of Synchronization \n (touch to sync video) \n " + (string)temptime2 + "% into the film, " + (string)temptime3 + " minutes until end of film/restart",<1,1,1>,1);
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_TIME,sectime2]);
}
else
{
sectime2 = 0;
sectime = sectime2;
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_TIME,sectime2]);
}
}
touch_start(integer num_detected)
{
llParcelMediaCommandList( [
PARCEL_MEDIA_COMMAND_URL, "rtsp://streaming.url.here.com/file.mp4",
PARCEL_MEDIA_COMMAND_TEXTURE, (key) llGetTexture(0), PARCEL_MEDIA_COMMAND_TIME,sectime, PARCEL_MEDIA_COMMAND_PLAY]);
llSay(0,"Synchronizing Video");
llSay(0,"You may have to press PAUSE then PLAY in your Media control panel if the video is playing choppy or you lose audio.");
}
}