llParcelMediaCommandList(list command_list)
How to Use QuickTime:
- Own land.
- Apply a texture to an object from your inventory that will eventually be replaced with the media stream.
- From "About Land/Options", use the GUI to select the texture above.
- Enter the URL of your media stream
- Use the little "Movie Control" box to play the media stream.
Additionally, you can:
- Create objects you want to use as PLAY, STOP, PAUSE & LOOP (play forever)
- Attach scripts to each, using the following information:
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 might still not be working |
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.
This article wasn't helpful for you? Maybe the
related article at the LSL Portal is able to bring enlightenment.
Functions |
Video |
WebContent