Skip to content
lsl.devlsl.devLSL Dev

LlSetPrimMediaParams

Looking for the current API? Open the llSetPrimMediaParams reference →

Wiki description

Set the media params for a particular face.

Return value notes

Returns an integer that is a STATUS_* flag which details the success/failure of the operation(s).

Specification

STATUS_OK integer 0 m=3 c=Result of function call was success
STATUS_MALFORMED_PARAMS integer 1000 m=3 c=Function was called with malformed parameters
STATUS_TYPE_MISMATCH integer 1001 m=3 c=Argument(s) passed to function had a type mismatch
STATUS_BOUNDS_ERROR integer 1002 m=3 c=Argument(s) passed to function had a bounds error
STATUS_NOT_FOUND integer 1003 m=3 c=Object or other item was not found
STATUS_NOT_SUPPORTED integer 1004 m=3 c=Feature not supported
STATUS_INTERNAL_ERROR integer 1999 m=3 c=An internal error occurred
STATUS_WHITELIST_FAILED integer 2001 m=3 c=Whitelist Failed
Success/Failure Flags Description
PRIM_MEDIA_ALT_IMAGE_ENABLE integer 0 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_ALT_IMAGE_ENABLE"
PRIM_MEDIA_CONTROLS integer 1 b=[  e= ] s=rowspan="4" s1=id="PRIM_MEDIA_CONTROLS"
PRIM_MEDIA_CONTROLS_STANDARD integer 0 m=3 s3=colspan="6" s1=id="PRIM_MEDIA_CONTROLS_STANDARD" c=Standard web navigation controls.
PRIM_MEDIA_CONTROLS_MINI integer 1 m=3 s3=colspan="6" s1=id="PRIM_MEDIA_CONTROLS_MINI" c=Mini web navigation controls; does not include an address bar.
PRIM_MEDIA_CURRENT_URL integer 2 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_CURRENT_URL"
PRIM_MEDIA_HOME_URL integer 3 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_HOME_URL"
PRIM_MEDIA_AUTO_LOOP integer 4 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_AUTO_LOOP"
PRIM_MEDIA_AUTO_PLAY integer 5 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_AUTO_PLAY"
PRIM_MEDIA_AUTO_SCALE integer 6 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_AUTO_SCALE"
PRIM_MEDIA_AUTO_ZOOM integer 7 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_AUTO_ZOOM"
PRIM_MEDIA_FIRST_CLICK_INTERACT integer 8 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_FIRST_CLICK_INTERACT"
PRIM_MEDIA_WIDTH_PIXELS integer 9 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_WIDTH_PIXELS"
PRIM_MEDIA_HEIGHT_PIXELS integer 10 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_HEIGHT_PIXELS"
PRIM_MEDIA_WHITELIST_ENABLE integer 11 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_WHITELIST_ENABLE"
PRIM_MEDIA_WHITELIST integer 12 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_WHITELIST"
PRIM_MEDIA_PERMS_INTERACT integer 13 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_PERMS_INTERACT"
PRIM_MEDIA_PERMS_CONTROL integer 14 b=[  e= ] s=rowspan="1" s1=id="PRIM_MEDIA_PERMS_INTERACT"
Parameter Additional Parameters Description
[ integer boolean ] Sets 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.
[ integer control ] Sets the style of controls. Can be either PRIM_MEDIA_CONTROLS_STANDARD or PRIM_MEDIA_CONTROLS_MINI.
controls Flags Description
[ string current_url ] Sets the current url displayed on the chosen face. Changing this URL causes navigation. 1024 characters Max
[ string home_url ] Sets the home url for the chosen face. 1024 characters max
[ integer boolean ] Sets whether auto-looping is enabled.
[ integer boolean ] Sets whether the media auto-plays when a Resident can view it.
[ integer boolean ] Sets whether auto-scaling is enabled. Auto-scaling forces the media to the full size of the texture.
[ integer boolean ] Sets whether clicking the media triggers auto-zoom and auto-focus on the media.
[ integer boolean ] Sets what happens when someone click on a playing, but unfocused media face:
  • TRUE: Does the same thing a focused media face does, and forwards the click to the web browser.
  • FALSE: Focuses the media prim so that future clicks are forwarded to the web browser.
Note: Viewer settings affect this flag. It works by default on most prims.
[ integer width ] Sets the width of the media in pixels.
[ integer height ] Sets the height of the media in pixels.
[ integer boolean ] Sets whether navigation is restricted to URLs in PRIM_MEDIA_WHITELIST.
[ string CSV ] Sets the whitelist as a string of escaped, comma-separated URLs. This string can hold up to 64 URLs or 1024 characters, whichever comes first.
[ integer perms ] Sets the permissions mask that control who can interact with the object:
[ integer perms ] Sets the permissions mask that control who can see the media control bar above the object:

Caveats

  • If prim-media is not already on this object, add it.
  • Params not specified are unchanged, or if new media is added set to the default specified.
  • Both width and height must be specified together to work, and they narrow the texture space while inversely widening the aperture.
    • width and height scaled larger than 1024pixels will require the texture backdrop to be resized to fit(see Useful Snippets)
      • if resized to fit, the resulting view will cut off scrolled content outside the bounds making it impossible to be viewed
  • Face needs to be a single face. If you want the media on multiple faces (e. g. opposing sides of an object), you have to call the function multiple times with different face numbers. Bitwise AND for face numbers does not work.
  • PRIM_MEDIA_FIRST_CLICK_INTERACT can be overridden by the viewer setting Me > Preferences > Sound & Media > Media first-interact. By default, it works on Worn HUDs, Owned Objects, Friend Objects, Group Objects, and Landowner Objects

Helper functions

//-- expand media textures greater than 1024 pixel in a direction to fit the media face
//-- does exactly what the "align" button does in the edit window (width/height are in pixels)
//-- original by Edelman Linden (or Kate Linden), tweaked by Void Singer
uExpandMediaTexture( integer vIntWidth, integer vIntHeight, integer vIntFace ){
    integer vIntTemp;
    vector  vSizScale;
    
    while (vIntWidth >> ++vIntTemp);
    vSizScale.x = vIntWidth / (float)(1 << vIntTemp);
    vIntTemp = 0;
    while (vIntHeight >> ++vIntTemp);
    vSizScale.y = vIntHeight / (float)(1 << vIntTemp);
    llSetPrimitiveParams( [PRIM_TEXTURE, vIntFace] +
                          llListReplaceList( llGetPrimitiveParams( [PRIM_TEXTURE, vIntFace] ),
                                             [vSizScale, ((vSizScale - <1.0, 1.0, 0.0>) / 2.0)],
                                             1,
                                             2 ) );
}

See also: functions

See also: articles

History

  • SVN:2816 r134947 Trunk
  • SVC-4939
  • Functionality available in Client 2.0

Shared wiki helpers

The original page also injects shared parameter notes, caveats or issue information through these helpers. Their conditional MediaWiki logic is not reproduced here; inspect the preserved helper source for additional material.

Template:Issues/SVC-4939

Original shared helper source (conditional wiki logic is not evaluated)
{{Issues|SVC-4939|[http://svn.secondlife.com/trac/linden/changeset/2816 SVN Changeset 2816 in Trunk] is immature|type=bug|dnc=*}}

Template:Issues/VWR-17719

Original shared helper source (conditional wiki logic is not evaluated)
{{Issues|VWR-17719|[[llSetPrimMediaParams]] [[PRIM_MEDIA_FIRST_CLICK_INTERACT]] doesn't work|type=bug}}

Template:LSL Function/face

Original shared helper source (conditional wiki logic is not evaluated)
{{LSL Injection Test}}{{#if:

{{#vardefine:header|{{#var:header}}{{#if:{{{nc|}}}{{#pos:{{#var:moded}}|r}}||{{#switch:{{NAMESPACE}}|Template=|User=|[[Category:LSL Face{{#var:lang}}]][[Category:LSL Face{{#var:lang}}/{{#if:{{{return|}}}{{{returns|}}}|Get|Set}}]]}}}}}}

{{#vardefine:ALL_SIDES|{{LSL Const|ALL_SIDES|integer|-1|hex=0xFFFFFFFF}}}}

{{#vardefine:p_{{{1|none}}}_desc|{{LSLGC|Face{{#var:lang}}|face}} number{{#ifeq:{{{notall|}}}|*||<nowiki> </nowiki>or {{#var:ALL_SIDES}}}}}}

{{#vardefine:p_{{{1|none}}}_hover|face number{{#ifeq:{{{notall|}}}|*||<nowiki> </nowiki>or ALL_SIDES (-1)}}}}

{{#ifeq:{{{notall|}}}|*||{{#vardefine:facechoise|If {{LSLP|{{{1|none}}}}} is {{#var:ALL_SIDES}} then the {{#if:{{{2|}}}|{{{2|}}}|function}} {{#if:{{{get|}}}|{{{get|}}}|{{#if:{{{ALL_SIDES|}}}|{{{ALL_SIDES|}}}|works on all sides.}}}}}}}}

{{#vardefine:header_footnote|{{#var:header_footnote}}{{#if:{{{!footer|}}}||{{PBR}}
{{#var:facechoise}}{{PBR}}}}}}

{{#vardefine:caveats|{{#var:caveats}}{{#if:{{{!footer|}}}|
*{{#var:facechoise}}|}}{{#if:{{{return|}}}{{{returns|}}}|
*If {{LSLP|{{{1|none}}}}} indicates a face that does not exist the {{#if:{{{2|}}}|{{{2|}}}}} {{#if:{{{return|}}}|return is {{{return|}}}| returns {{{returns|}}}}}|
*The {{#if:{{{2|}}}|{{{2|}}}|function}} silently fails if its {{LSLP|{{{1|none}}}}} value indicates a face that does not exist.}}}}

}}<noinclude>
{| {{Prettytable}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|ALL_SIDES}}
|-
{{VarPair|p_{{{1|none}}}_desc}}
|-
{{VarPair|p_{{{1|none}}}_hover}}
|-
{{VarPair|facechoise}}
|-
{{VarPair|header_footnote}}
|-
{{VarPair|caveats}}
|}
</noinclude>
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.