Jump to content

I am seeking help as to what script I need


PJ Mannequin
 Share

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

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

Recommended Posts

Hi,

I am doing this for a friend who runs a club and want to do a movie night but the problem is we need owner control over the movie without other users messing up but I have the code but not sure how to put the code into the script for the prim to play the said movie?

The movie is from youtube btw so nothing illegal but the problems starts when it coes to movie screen sizes. For example if I were to sue this url https://www.youtube-nocookie.com/embed/fSQp67o_HG8?rel=0&amp;controls=0&amp;showinfo=0&autoplay=1 the screen play area is small and would mean the prim to be hugely massive but no control ver screen sizes unless it is put inside the iframe htmal codes. So in this case <iframe width="1280" height="720" src="https://www.youtube-nocookie.com/embed/fSQp67o_HG8?rel=0&amp;controls=0&amp;showinfo=0&autoplay=1" frameborder="0" allowfullscreen></iframe> but how do I put this into the script so that the prim can play the said link as a media?

Thanks, PJ.

PS I did search the forum for ideas but not found something I am looking for or it there but not using the right search.

Link to comment
Share on other sites

This is the way I do it:

I just use a simple URL like 

Then I use the vertical and horizontal settings to just display the movie, not the rest of the web page:

 

position.png

You can now resize the prim to what ever you need.

 

 

And then use the custom page to prevent messing with it:

 

Custom.png

Link to comment
Share on other sites

for this particlular movie you would do something like this ( assumes the face is 2)

** youtube and other sites would require a different llScaleTexture size.

_________________________________________

integer face = 2;
string url = "https://www.youtube-nocookie.com/embed/fSQp67o_HG8?rel=0&controls=0&showinfo=0&autoplay=1";
default
{
    state_entry()
    {   llScaleTexture(1.0, 0.4, face);
        llSetPrimMediaParams(face,[ PRIM_MEDIA_AUTO_PLAY,TRUE, PRIM_MEDIA_CURRENT_URL,url ] );       
    }   
}

_____________________________________________

you could use a linked prim to control the on / off (owner only with lGetOwner() & llDetectedKey(0)  )

and use linked messages instead of just starting it in state entry.

for a linked prim you would use..

 llSetLinkMedia( linkNum,face,[ PRIM_MEDIA_AUTO_PLAY,TRUE, PRIM_MEDIA_CURRENT_URL,url ] );  

.depending on which prim is root etc..

Link to comment
Share on other sites

Thanks for that, the methods me and my friend was doing it was how Ohjiro was saying but the screen seems slightly distorted the large the screen is hence trying to figure how to use iframe codes into the prims.

 

I shall give Xiija idea a try and see how this goes, cos what we want to d is once everybody was ready my friend would then pop the prim up and then movies starts.

 

Thank you all, PJ

Link to comment
Share on other sites

Hi,

 

OK I did what Xiija idea and it works and now trying to get the listen on channel 55 to work so all my friend have to do is rez the prim up and the type /55 <URL> for example:-

 

/55 https://www.youtube-nocookie.com/embed/fSQp67o_HG8?rel=0&controls=0&showinfo=0&autoplay=1

Reason for the listen is each week the movies changes and to make it easy for my friend to type /55 <url> I did the script out as followed (she asked for it to be face 0) and it not working as I expected any ideas?

 

integer listenHandle;
integer face = 0;
string GetURL = " ";

remove_listen_handle()
{
llListenRemove(listenHandle);
}

default
{
state_entry()
{
listenHandle = llListen(55, "", llGetOwner(), "");
llScaleTexture(1.0, 0.4, face);
llSetPrimMediaParams(face,[ PRIM_MEDIA_AUTO_PLAY,TRUE, PRIM_MEDIA_CURRENT_URL,GetURL ] );
}

listen(integer channel, string name, key id, string message)
{
llOwnerSay("URL Accepted & Loading");
}

on_rez(integer start_param)
{
llResetScript();
}

changed(integer change)
{
if (change & CHANGED_OWNER)
{
llResetScript();
}
}
}

 Thanks, PJ

Link to comment
Share on other sites

I think you are setting the prim media params too early, ie on entry and not doing anything with the message (URL) when it arrives.

Try this.

Oh, and face 0 is the top of the prim as you rez a fresh one.

default
{
state_entry()
{
listenHandle = llListen(55, "", llGetOwner(), "");


}

listen(integer channel, string name, key id, string message)
{
llOwnerSay("URL Accepted & Loading");

llSetPrimMediaParams(face,[ PRIM_MEDIA_AUTO_PLAY,TRUE, PRIM_MEDIA_CURRENT_URL,message ] );

llScaleTexture(1.0, 0.4, face);
}

Link to comment
Share on other sites

SO the above then becomes like this?

 

integer listenHandle;
integer face = 0;
string GetURL = " ";

remove_listen_handle()
{
llListenRemove(listenHandle);
}

default
{
state_entry()
{
listenHandle = llListen(55, "", llGetOwner(), "");


}

listen(integer channel, string name, key id, string message)
{
llOwnerSay("URL Accepted & Loading");

llSetPrimMediaParams(face,[ PRIM_MEDIA_AUTO_PLAY,TRUE, PRIM_MEDIA_CURRENT_URL,message ] );

llScaleTexture(1.0, 0.4, face);
}


listen(integer channel, string name, key id, string message)
{
llOwnerSay("URL Accepted & Loading");
}

on_rez(integer start_param)
{
llResetScript();
}

changed(integer change)
{
if (change & CHANGED_OWNER)
{
llResetScript();
}
}
}

Link to comment
Share on other sites

Qie, my friend does not want anyone else enter the url via chat hence setting it to owner only as my friend be the owner.  She can create clothes and building ok but clueless when it comes to scripts so making it easy for her at the same time.

 

Just need to the the LListen and URL string to work via channel 55.

Link to comment
Share on other sites

You have two listen event handlers there just get rid of the second one see my strike out below.

PJ Mannequin wrote:

SO the above then becomes like this?

 

integer listenHandle;

integer face = 0;

string GetURL = " ";

 

remove_listen_handle()

{

llListenRemove(listenHandle);

}

 

 

default

{

state_entry()

{

listenHandle = llListen(55, "", llGetOwner(), "");

 

 

}

 

listen(integer channel, string name, key id, string message)

{

llOwnerSay("URL Accepted & Loading");

llSetPrimMediaParams(face,[ PRIM_MEDIA_AUTO_PLAY,TRUE, PRIM_MEDIA_CURRENT_URL,message ] );

llScaleTexture(1.0, 0.4, face);

}

 

listen(integer channel, string name, key id, string message)

{

llOwnerSay("URL Accepted & Loading");

}

 

on_rez(integer start_param)

{

llResetScript();

}

 

changed(integer change)

{

if (change & CHANGED_OWNER)

{

llResetScript();

}

}

}

 

Link to comment
Share on other sites

OK tried that and this is what I have,

integer listenHandle;
integer face = 0;
string GetURL = " ";

remove_listen_handle()
{
llListenRemove(listenHandle);
}

default
{
state_entry()
{
listenHandle = llListen(55, "", llGetOwner(), "");
}
listen(integer channel, string name, key id, string message)
{
llOwnerSay("URL Accepted & Loading");
llSetPrimMediaParams(face,[ PRIM_MEDIA_AUTO_PLAY,TRUE,PRIM_MEDIA_CURRENT_URL,message ] );
llScaleTexture(1.0, 0.4, face);
}
on_rez(integer start_param)
{
llResetScript();
}
changed(integer change)
{
if (change & CHANGED_OWNER)
{
llResetScript();
}
}
}

 

And just tried it and don't seems to work :(

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3240 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...