Jump to content

Scripting MOAP and looping query


DogWomble Dollinger
 Share

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

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

Recommended Posts

Hi everyone,

I think I may be missing something fairly trivial here.  I'm right now writing a script that will set the media-on-a-prim URL based off a menu item the user selects.  For this, I'm pointing directly to the MP4 file using this:

llParcelmediaComandList([PARCEL_MEDIA_COMMAND_URL, "URL_of_MP4"]);

This seems to work except for one small little detail.  Whenever the file finishes playing, it goes back and starts again.  What I want to do is set it to stop immediately on completion.

I did have the thought that I could set a timer or sleep event for the duration of the video, and then stop playback - though I did notice that it sometimes takes a couple of seconds for the video to load and start playing.  I'm not sure if this delay is consistent amongst all viewers - ie. whether it's just part of the script sleeping for 2 seconds when this function is called.

Is there a better way of doing this that I'm missing?

  • Like 1
Link to comment
Share on other sites

9 minutes ago, DogWomble Dollinger said:

Hi everyone,

I think I may be missing something fairly trivial here.  I'm right now writing a script that will set the media-on-a-prim URL based off a menu item the user selects.  For this, I'm pointing directly to the MP4 file using this:

llParcelmediaComandList([PARCEL_MEDIA_COMMAND_URL, "URL_of_MP4"]);

This seems to work except for one small little detail.  Whenever the file finishes playing, it goes back and starts again.  What I want to do is set it to stop immediately on completion.

I did have the thought that I could set a timer or sleep event for the duration of the video, and then stop playback - though I did notice that it sometimes takes a couple of seconds for the video to load and start playing.  I'm not sure if this delay is consistent amongst all viewers - ie. whether it's just part of the script sleeping for 2 seconds when this function is called.

Is there a better way of doing this that I'm missing?

I'm not sure what the default behaviour is when using llParcelMediaCommandList but, according to the wiki, you should be able to specify the type of behaviour you require using the PARCEL_MEDIA_COMMAND_PLAY & PARCEL_MEDIA_COMMAND_LOOP constants which, as the names suggest, will cause the media to play once or loop continuously.

Link to comment
Share on other sites

On 12/23/2021 at 7:20 PM, DogWomble Dollinger said:

media-on-a-prim

Only because the title of the thread also mentions "MOAP" it may be relevant that llParcelMediaCommandList isn't about MOAP, which is instead manipulated with llSetPrimMediaParams and llSetLinkMedia. God knows MOAP has its problems, too, but I just wouldn't want confusion between the two, inasmuch as both can be manipulated manually, too, as well as by script.

  • Thanks 1
Link to comment
Share on other sites

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