Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llParcelMediaCommandList and (float) START_TIME

Dz Questi
Registered User
Join date: 15 Jul 2008
Posts: 13
01-16-2009 12:01
I have a sequence of MP4 videos that I want to play.. Some of them have "recap" lead ins on them that are made for people who take a break between viewings, but they can be annoying for people who want to watch them one after another......

The Wiki example led me to believe that I could pick a start time in each of the videos....

http://lslwiki.net/lslwiki/wakka.php?wakka=llParcelMediaCommandList

touch_start(integer num_detected)
{
llParcelMediaCommandList( [
PARCEL_MEDIA_COMMAND_AGENT, llDetectedKey(0),
PARCEL_MEDIA_COMMAND_TIME, START_TIME,
PARCEL_MEDIA_COMMAND_PLAY ] );
list Info = llParcelMediaQuery([PARCEL_MEDIA_COMMAND_URL, PARCEL_MEDIA_COMMAND_TEXTURE]);
llSay(0, "Playing '" + llList2String(Info, 0) + "' on texture '" + (string)llList2Key(Info, 1) + "' for agent " + llDetectedName(0));
llSetTimerEvent(RUN_LENGTH);
}



...by setting the start time to a (float) offset.

Well I tried it, and it "almost never" works... Most of the videos just load and play from offset 0.0. If I "back up" and replay the video after it has loaded for a while... "MOST of the time" the offset is observed ( so I know it is not a coding or parameter error)....

OK I figured it has something to do with how long it takes to load the video from the server, so I re-designed the sequence to check to see if there was an offset ... if there is , I do a "change the URL and pause..." depending on the 2 second function delay to allow for some processing mechanics, then repeat the llParcelMediaCommandList command with the start location and play...

Now.. SOMETIMES the offset works, and sometimes it doesn't..... of course , because I have the timer "adjusted" to compensate for the new length, the end of the video will get chopped of....

PLEASE, can someone tell me HOW HARD CAN IT BE to set an offset into a media file and ONLY play it from there? (and provide a WORKING example...) THANKIES!
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
01-17-2009 07:27
I would guess it depends on the source and exact format of the media, rather than anything you can do in code through SL. For example, if you watch some videos online in your web-browser, you can't actually skip ahead until the entire video has been buffered. I should imagine the same is true in this context with whatever media you are using (and bear in mind there can be format variations between different files of the same type).

All I can suggest is trying different video formats and hosting them elsewhere, and seeing what happens. For example, try turning a video into .mov format and putting it on a regular (non-streaming) web-host, if possible.