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 |
| 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. |
Most of the QuickTime media file formats are supported, including:
- QuickTime movies (.mov)
- Streamable stored QuickTime movies (.mov)
- Real time QuickTime streams (rtsp://)
- MPEG4 movies (.mp4, .mpeg4) (simple profile only)
- QuickTime VR scenes and objects (.mov)
- Flash movies (.swf) (only non-interative, version 5 and earlier)
- Many more - See QuickTime 7 Supported Video Formats List
- Note: not all of these may play. A good rule of thumb is if it plays in the QuickTime Media Player, it will play in Second Life.
- You may also retrieve the current URL and/or texture used for the movie by calling llParcelMediaQuery. See the LSL documentation for more details.
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()
{
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.
If you just want to stream music, use
llSetParcelMusicURL.
Functions |
Video