Jump to content

llSetPrimMediaParams


Kostya Noyes
 Share

You are about to reply to a thread that has been inactive for 2650 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello all!

Object with script on ground.

Script use function llSetPrimMediaParams for show URL on face object but not work autoplay

 

function init(string scriptUrl) {   
string url = "https://someurl.com/script.php?url=" + scriptUrl; integer face = 4; llClearPrimMedia(face); llSetPrimMediaParams(face, [
PRIM_MEDIA_HOME_URL, url, PRIM_MEDIA_CURRENT_URL, url, PRIM_MEDIA_AUTO_SCALE, FALSE, PRIM_MEDIA_FIRST_CLICK_INTERACT, TRUE, PRIM_MEDIA_AUTO_PLAY, TRUE, PRIM_MEDIA_PERMS_CONTROL, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_WIDTH_PIXELS, 608, PRIM_MEDIA_HEIGHT_PIXELS, 454 ]);
}

key requestID; //ID региона

default {
state_entry() {
requestID = llRequestSecureURL();
}

http_request(key id, string method, string body) {
llOwnerSay(id);
llOwnerSay(method);
llOwnerSay(body);

if (method == URL_REQUEST_GRANTED) {
if (id == requestID) {
init(llEscapeURL(body));
}
}
}

But URL show then touch left key mouse on object.

How set auto start URL?

Link to comment
Share on other sites

I assume that you have only posted a part of your script, because the init() function that you are calling in the http_request event does not exist in the part you have shown here. Also, the functions

  llClearPrimMedia(face);   llSetPrimMediaParams(face, [        PRIM_MEDIA_CURRENT_URL, url,         PRIM_MEDIA_AUTO_SCALE, FALSE,         PRIM_MEDIA_FIRST_CLICK_INTERACT, TRUE,        PRIM_MEDIA_AUTO_PLAY, TRUE,        PRIM_MEDIA_PERMS_CONTROL, PRIM_MEDIA_PERM_NONE,        PRIM_MEDIA_WIDTH_PIXELS, 608,         PRIM_MEDIA_HEIGHT_PIXELS, 454    ]);

cannot be used outside of a state, so they do not belong in the global declaration area of your script.  I am guessing that all of the material at the top of your script is therefore actually part of the user-defined function, init(), that you are not showing.

In theory, the parameters you have written should autostart the URL.  To be sure, you should also include PRIM_MEDIA_HOME_URL , and you may want to remove PRIM_MEDIA_FIRST_CLICK_INTERACT, which doesn't seem to do anything at all.

  • Like 1
Link to comment
Share on other sites

Hello!
Yeah, I bad copied. Now final code, I added PRIM_MEDIA_HOME_URL.
But users don't see content on face of object, only after click on them.

Other question:

Object placed on ground, with him interact different users.

When user click on button on Web content, how  I can detect his ID for permisson function?

llRequestPermissions(user_id, PERMISSION_DEBIT);

 One way is create link objects on buttons in web page?

Link to comment
Share on other sites


Kostya Noyes wrote:

[ .... ]

But users don't see content on face of object, only after click on them.
[ .... ]


Yes, that's why I wrote that "In theory" your code should work.  In practice, I have never seen prim media start automatically.


Kostya Noyes wrote:

[ .... ]

Other question:

Object placed on ground, with him interact different users.

When user click on button on Web content, how  I can detect his ID for permisson function?
llRequestPermissions(user_id, PERMISSION_DEBIT);

 One way is create link objects on buttons in web page?

If you are asking permission in an event in your script, you will need to use a run_time_permissions event to detect whether a user has granted any requested permission. You cannot get that permission directly by looking to see whether someone has clicked a link on an external web site, although you might be able to use LSL's llHTTP functions and events in conjunction with scripts on the external server to get that permission.

Be extremely carefull when you write any script that asks for PERMISSION_DEBIT. It is easy to abuse that permission or to create problems accidentally, leaving users vulnerable to theft.  Before you release any such script for public use, test it thoroughly with several alts or close friends to be sure that you have not made coding errors.  When you request PERMISSION_DEBIT, you are asking for direct access to the person's account.  If you are trying to write a vendor, there are other, safer ways to ask a user to pay a specific amount for your product, or to make a voluntary contribution.

Link to comment
Share on other sites


Rolig Loon wrote:


Kostya Noyes wrote:

[ .... ]

But users don't see content on face of object, only after click on them.
[ .... ]


Yes, that's why I wrote that "
In theory
" your code should work.  In practice, I have never seen prim media start automatically.



I have some MOP objects that auto-play IF I turn on the "Allow media to auto-play" option in Preferences.  If not I see my "Media on A Prim" texture until I click the  object.  Firestorm viewer is all I can speak to.  The experience of others may vary.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2650 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...