Don't click here unless you want to be banned.

LSL Wiki : llParcelMediaCommandList

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are xcrawl107.alexa.com
llParcelMediaCommandList(list command_list)

How to Use QuickTime:


Additionally, you can:

You are allowed one movie (or "media" resource) per land parcel. The movie will be played by replacing a texture on an object with the movie. Users will only see the movie when they are standing on your land parcel. Otherwise they will see the static texture. Script functions only work for objects owned by the land owner or deeded to the group that owns the land. (Remember to set asset permissions on your script and object as well as sharing it with the group!)

Note: This function delays the script for 2.0 seconds.

Currently supported llParcelMediaCommandList options are:

Flag Value Parameter Description
PARCEL_MEDIA_COMMAND_STOP 0 - stop the media stream and go back to the first frame
PARCEL_MEDIA_COMMAND_PAUSE 1 - pause the media stream (stop playing but stay on current frame)
PARCEL_MEDIA_COMMAND_PLAY 2 - start the current media stream playing and stop when the end is reached
PARCEL_MEDIA_COMMAND_LOOP 3 - start the current media stream playing, loop to the beginning when the end is reached and continue to play
PARCEL_MEDIA_COMMAND_TEXTURE 4 key texture specifies the texture to replace with video Note: If passing the key of a texture, it must be explicitly typecast as a key, not just passed within double quotes.
PARCEL_MEDIA_COMMAND_URL 5 string url specifies the movie URL (254 characters)
PARCEL_MEDIA_COMMAND_TIME 6 float time specifies the time index at which to begin playing
PARCEL_MEDIA_COMMAND_AGENT 7 key agent specifies a single agent to apply the media command to
PARCEL_MEDIA_COMMAND_UNLOAD 8 - unloads the stream. While the stop command sets the texture to the first frame of the movie, unload resets it to the real texture that the movie was replacing.
PARCEL_MEDIA_COMMAND_AUTO_ALIGN 9 integer enable turns on/off the auto align feature, similar to the auto align checkbox in the parcel media properties (NOT to be confused with the "align" function in the textures view of the editor!) Takes TRUE or FALSE as parameter.
PARCEL_MEDIA_COMMAND_TYPE 10 string Allows a Web page or image to be placed on a prim (1.19.1 RC0 and later only). Use "text/html" for HTML.
PARCEL_MEDIA_COMMAND_SIZE 11 integer x, integer y Resizes a Web page to fit on x, y pixels (1.19.1 RC0 and later only). Note: this is currently not working (see http://jira.secondlife.com/browse/SVC-1783)
PARCEL_MEDIA_COMMAND_DESC 12 string Sets a description for the media being displayed (1.19.1 RC0 and later only).

Most of the QuickTime media file formats are supported, including:


Since 1.19.1 RC0, you can also load a Web page on a prim. Just set PARCEL_MEDIA_COMMAND_URL to the URL and PARCEL_MEDIA_COMMAND_TYPE to "text/html".

Example:
default
{
    touch_start ( integer total_number )
    {
        llParcelMediaCommandList ( [ PARCEL_MEDIA_COMMAND_LOOP ] );
    }
}

Advanced example:
float START_TIME = 30.0;
float RUN_LENGTH = 10.0;

default
{
    state_entry()
    {
        if ( llParcelMediaQuery([PARCEL_MEDIA_COMMAND_TEXTURE]) == [] )
            llSay(0, "Lacking permission to set/query parcel media. This object has to be owned by/deeded to the land owner.");
        llParcelMediaCommandList( [
            PARCEL_MEDIA_COMMAND_URL, "http://enter_your.url/here",
            PARCEL_MEDIA_COMMAND_TEXTURE, (key) llGetTexture(0) ] );
    }

    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);
    }

    timer()
    {
        llParcelMediaCommandList( [ PARCEL_MEDIA_COMMAND_STOP ] );
        llSetTimerEvent(0.0);
    }
}

Q: It's not working! What's wrong?
A: Are you running it over group-owned land? You need to make sure you own the land, or that the script is deeded to the group that owns the land. When deeding, remember to set all asset permissions and check "Share with Group" beforehand.

Q: When calling Web Content, what will PARCEL_MEDIA_COMMAND_LOOP accomplish that PARCEL_MEDIA_COMMAND_PLAY will not?
A: Personally I don't see any difference. If there is one, please modify the Wiki to expand on the details of how one function differs from the other. With the release of 1.19.1 RC0 there appears to be no particular looping taking place. Refreshing a dynamic webpage MAY still be accomplished by creating a timer-based loop that initiates additional calls to PARCEL_MEDIA_COMMAND_PLAY. While the same may be accomplished through calls to PARCEL_MEDIA_COMMAND_LOOP, one could easily reach the faulty assumption that a LOOP might reload the page as discrete intervals. However, no such reloading seems to take place, and given the static nature assumed for web pages (at least in the first implementation of this feature), since there is no modifier associated with the LOOP command, it's hard to see how this would be the preferred call. (Revision and amplification invited and encouraged on this and related questions pertaining to new functionality implemented beginning with 1.19.1 RC0.)

If you just want to stream music, use llSetParcelMusicURL.


Functions | Video | WebContent
Comments [Hide comments/form]
I'm a bit confused on what PARCEL_MEDIA_COMMAND_TIME actually does. Would someone be able to explain it?
-- DerekJones (2005-03-31 08:51:56)
To syncronize streams with everybody in the same parcel, is it possible to use PARCEL_MEDIA_COMMAND_PLAY, or will this have only an effect on each client's individual computer? I have seen people asking to press the play button at the same time (after a count by an event hoster), so does this mean that PARCEL_MEDIA_COMMAND_PLAY will only work client-side?
-- GwynethLlewelyn (2006-01-21 05:09:06)
I found a little hack to work with this. I had a cleint that wanted the texture to be restored when the video was stopped (via script, not the client button). I found passing an empty string to the list argument PARCEL_MEDIA_COMMAND_URL basicaly turns streaming video off, "restoring" the texture that was replaced.
-- ZenMondo (2007-04-13 20:31:27)
Trying again. This command will reset an agent's media sim wide.

This can have a white use, because that means that with an "antenna" an av can be allowed to reset their media and it will play across the sim, or a black use, because a target avatar can be griefed or have their IP address harvested.
-- LillieYifu (2007-10-24 14:20:13)
For the record, my comment doesn't take into account the two possible ways of getting video to display on a parcel. The first is by linking to a static file — progressive download. The second is using real-time streaming protocol (RTSP) ie. using a real streaming server, not progressive download. Only the latter allows accurate positioning of the video at any moment and ensures (specially for a large video) that everybody is watching at the same time. Under progressive download, everybody needs to download a bit of the video first (enough to fill the buffers at least; sometimes taking minutes) and only then will they be displayed. Stopping the movie under these circumstances will jump back to the beginning of it; and with progressive downloads there is no way to synchronise the video for all viewers, except, of course, manually.

Mind Lillie Yifu's comment, though... PARCEL_MEDIA_COMMAND_AGENT can be used to effectively target an URL to any avatar inside the same sim, and, instead of "streaming", run a server-side script that will indeed pick that avatar's IP address (and using GeoIP, even it's approximate location). PARCEL_MEDIA_COMMAND_AGENT is a very useful feature but since it can be abused in this way, there should be a warning. Currently you have no way to ever know you're being targetted for IP harvesting that way.
-- GwynethLlewelyn (2007-10-26 04:35:43)
Attach a comment to this page: