Difference between revisions of "LlGetLinkMedia"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "<!-- {{LSL Generic/RC|RC Magnum}} --> {{LSL_Function/face|face|notall=*}}{{LSL_Function |mode=pre-release |func_id=?|func_sleep=0.0|func_energy=0.0|mode |func=LlG…")
 
m (group results would be useless)
Line 1: Line 1:
<!-- {{LSL Generic/RC|[[Beta/Magnum|RC Magnum]]}} -->
<!-- {{LSL Generic/RC|[[Beta/Magnum|RC Magnum]]}} -->
{{LSL_Function/face|face|notall=*}}{{LSL_Function
{{LSL_Function
|inject-2={{LSL_Function/face|face|notall=*}}{{LSL_Function/link|link|nogroup=*}}
|mode=pre-release
|mode=pre-release
|func_id=?|func_sleep=0.0|func_energy=0.0|mode
|func_id=?|func_sleep=0.0|func_energy=0.0|mode

Revision as of 20:49, 3 August 2011

Emblem-important-red.png Pre-release Documentation Warning!

This function is not available yet. This documentation was written prior to its final release so it may not match the final implementation.

Summary

Function: list LlGetLinkMedia( integer link, integer face, list params );

Get the media params for a particular face on a link'ed prim, given the desired list of named params.
Returns a list of values in the order requested.

• integer link Link number (0: unlinked, 1: root prim, >1: child prims and seated avatars) or a LINK_* flag
• integer face face number
• list params a set of names (in no particular order)

Returns an empty list if no media exists on the face(s).

Flag Description
LINK_ROOT 1 refers to the root prim in a multi-prim linked set[1]
Flag Description
LINK_THIS -4 refers to the prim the script is in

Parameter Return Values Description
PRIM_MEDIA_ALT_IMAGE_ENABLE ] 0 [ integer boolean ] Gets the default image state (the image that the user sees before a piece of media is active) for the chosen face. The default image is specified by Second Life's server for that media type.

Note: This flag is not currently implemented.

PRIM_MEDIA_CONTROLS ] 1 [ integer control ] Gets the style of controls. Can be either PRIM_MEDIA_CONTROLS_STANDARD or PRIM_MEDIA_CONTROLS_MINI.
controls Flags Description
PRIM_MEDIA_CONTROLS_STANDARD 0 Standard web navigation controls.
PRIM_MEDIA_CONTROLS_MINI 1 Mini web navigation controls; does not include an address bar.
PRIM_MEDIA_CURRENT_URL ] 2 [ string current_url ] Gets the current url displayed on the chosen face. Changing this URL causes navigation. 1024 characters Max
PRIM_MEDIA_HOME_URL ] 3 [ string home_url ] Gets the home url for the chosen face. 1024 characters max
PRIM_MEDIA_AUTO_LOOP ] 4 [ integer boolean ] Gets whether auto-looping is enabled.
PRIM_MEDIA_AUTO_PLAY ] 5 [ integer boolean ] Gets whether the media auto-plays when a Resident can view it.
PRIM_MEDIA_AUTO_SCALE ] 6 [ integer boolean ] Gets whether auto-scaling is enabled. Auto-scaling forces the media to the full size of the texture.
PRIM_MEDIA_AUTO_ZOOM ] 7 [ integer boolean ] Gets whether clicking the media triggers auto-zoom and auto-focus on the media.
PRIM_MEDIA_FIRST_CLICK_INTERACT ] 8 [ integer boolean ] Gets whether the first click interaction is enabled.

Note: This flag appears not to work.

PRIM_MEDIA_WIDTH_PIXELS ] 9 [ integer width ] Gets the width of the media in pixels.
PRIM_MEDIA_HEIGHT_PIXELS ] 10 [ integer height ] Gets the height of the media in pixels.
PRIM_MEDIA_WHITELIST_ENABLE ] 11 [ integer boolean ] Gets whether navigation is restricted to URLs in PRIM_MEDIA_WHITELIST.
PRIM_MEDIA_WHITELIST ] 12 [ string CSV ] Gets the whitelist as a string of escaped, comma-separated URLs. This string can hold up to 64 URLs or 1024 characters, whichever comes first.
PRIM_MEDIA_PERMS_INTERACT ] 13 [ integer perms ] Gets the permissions mask that control who can interact with the object:
PRIM_MEDIA_PERMS_CONTROL ] 14 [ integer perms ] Gets the permissions mask that control who can see the media control bar above the object:

Caveats

Examples

Notes

Link Numbers

Each prim that makes up an object has an address, a link number. To access a specific prim in the object, the prim's link number must be known. In addition to prims having link numbers, avatars seated upon the object do as well.

  • If an object consists of only one prim, and there are no avatars seated upon it, the (root) prim's link number is zero.
  • However, if the object is made up of multiple prims or there is an avatar seated upon the object, the root prim's link number is one.

When an avatar sits on an object, it is added to the end of the link set and will have the largest link number. In addition to this, while an avatar is seated upon an object, the object is unable to link or unlink prims without unseating all avatars first.

Counting Prims & Avatars

There are two functions of interest when trying to find the number of prims and avatars on an object.

integer GetPrimCount() { //always returns only the number of prims
    if(llGetAttached())//Is it attached?
        return llGetNumberOfPrims();//returns avatars and prims but attachments can't be sat on.
    return llGetObjectPrimCount(llGetKey());//returns only prims but won't work on attachments.
}
See llGetNumberOfPrims for more about counting prims and avatars.

Errata

If a script located in a child prim erroneously attempts to access link 0, it will get or set the property of the linkset's root prim. This bug (BUG-5049) is preserved for broken legacy scripts.

See Also

Functions

•  llGetLinkNumber Returns the link number of the prim the script is in.
•  LlGetPrimMediaParams
•  llSetLinkMedia
•  llClearLinkMedia

Deep Notes

History

  • Scheduled for RC Magnum channel, week of August 3, 2011.

Footnotes

  1. ^ LINK_ROOT does not work on single prim objects. Unless there is an avatar sitting on the object.

Signature

function list LlGetLinkMedia( integer link, integer face, list params );
integer PRIM_MEDIA_ALT_IMAGE_ENABLE = 0;
integer PRIM_MEDIA_CONTROLS = 1;
integer PRIM_MEDIA_CURRENT_URL = 2;
integer PRIM_MEDIA_HOME_URL = 3;
integer PRIM_MEDIA_AUTO_LOOP = 4;
integer PRIM_MEDIA_AUTO_PLAY = 5;
integer PRIM_MEDIA_AUTO_SCALE = 6;
integer PRIM_MEDIA_AUTO_ZOOM = 7;
integer PRIM_MEDIA_FIRST_CLICK_INTERACT = 8;
integer PRIM_MEDIA_WIDTH_PIXELS = 9;
integer PRIM_MEDIA_HEIGHT_PIXELS = 10;
integer PRIM_MEDIA_WHITELIST_ENABLE = 11;
integer PRIM_MEDIA_WHITELIST = 12;
integer PRIM_MEDIA_PERMS_INTERACT = 13;
integer PRIM_MEDIA_PERM_OWNER;
integer PRIM_MEDIA_PERM_GROUP;
integer PRIM_MEDIA_PERM_ANYONE;
integer PRIM_MEDIA_PERMS_CONTROL = 14;

integer PRIM_MEDIA_CONTROLS_STANDARD = 0;//Standard web navigation controls.
integer PRIM_MEDIA_CONTROLS_MINI = 1;//Mini web navigation controls; does not include an address bar.