Jump to content

Parcel Media on a Prim


ancapbarbie
 Share

Recommended Posts

I'm not even sure I know how to properly ask this question, so forgive me for that and that variations of this question have been asked and answered so many times over the years, I'm not sure which one applies.

Some TV's in Second Life - or more accurately their routers - will set a parcel media url based on whatever url is playing through the device and then some version of media on a prim to display on multiple screens/surfaces simultaneously. As parcel media, this allows everyone on the parcel to watch the same movie, for example, roughly in sync.

VEA TV's do this. They're the only ones I've found that do. They appear to be deprecated though - still looking for Flash I think - and I'm not sure they're still maintained. Others can do so via livestreaming - OBS for example - but that requires more computer resources than seems necessary and runs a higher script load on my parcel for each screen broadcasting.

What I'm trying to do is movie night, showing the same movie on eight screens simultaneously for everyone on the parcel to watch roughly in sync, as much as possible with different connection speeds and such.

My question, as well as I can ask it, is how does one make media on a prim (or mesh) work with parcel media, and secondly how to make an object set and change the parcel media url based on the url sent to the object for playback.

Again, apologies if I was unable to find where this question has already been answered.

 

Link to comment
Share on other sites

  •  "parcel media on a prim" (for my sanity, lets call it 'PM') is (confusingly) different than "media on a prim" (MOAP) TL;DR MOAP is newer, but has different caveats.
  • If you have more than one screen in the same room that needs to show the same movie, PM is the 'correct' one to use.
    • Parcel media has 2 parts, the URL and the 'media texture'. Every instance of the texture on the parcel* will be 'replaced' by the movie with no extra script required in the object itself.
    • Both can be set via script with https://wiki.secondlife.com/wiki/LlParcelMediaCommandList or can be changed manually in land settings.
    • It's been a while since I tested it, but IIRC, parcel media does NOT synchronize between observers when someone enters or leaves the parcel.
  • If you only have one screen, I wrote a script that uses MOAP to show the movie. It should keep things more in sync for people entering the area late, but also does not compensate for slow connection speeds. It expects a link to a video file (any common format) as a global variable, and is more 'proof of concept' than finished product:

 

* parcel media displays on particles, but IIRC, not projection lights nor other advanced materials

ETA: getting PM to show up at all can be a bit hit-or miss, but maybe that's just me, and I don't seem to be getting audio from it? anyway, can confirm it restarts from the beginning when leaving/ re-entering the parcel.

Edited by Quistess Alpha
Link to comment
Share on other sites

  • 9 months later...
On 6/26/2023 at 8:56 PM, Quistess Alpha said:
  •  "parcel media on a prim" (for my sanity, lets call it 'PM') is (confusingly) different than "media on a prim" (MOAP) TL;DR MOAP is newer, but has different caveats.
  • If you have more than one screen in the same room that needs to show the same movie, PM is the 'correct' one to use.
    • Parcel media has 2 parts, the URL and the 'media texture'. Every instance of the texture on the parcel* will be 'replaced' by the movie with no extra script required in the object itself.
    • Both can be set via script with https://wiki.secondlife.com/wiki/LlParcelMediaCommandList or can be changed manually in land settings.
    • It's been a while since I tested it, but IIRC, parcel media does NOT synchronize between observers when someone enters or leaves the parcel.
  • If you only have one screen, I wrote a script that uses MOAP to show the movie. It should keep things more in sync for people entering the area late, but also does not compensate for slow connection speeds. It expects a link to a video file (any common format) as a global variable, and is more 'proof of concept' than finished product:

 

* parcel media displays on particles, but IIRC, not projection lights nor other advanced materials

ETA: getting PM to show up at all can be a bit hit-or miss, but maybe that's just me, and I don't seem to be getting audio from it? anyway, can confirm it restarts from the beginning when leaving/ re-entering the parcel.

When using web content on PM is it possible to detect touches of hyperlinks that open new windows or tabs?  These seem to do nothing and it would be nice to process them in some way. Thanks!

Link to comment
Share on other sites

1 hour ago, musichero said:

When using web content on PM is it possible to detect touches of hyperlinks that open new windows or tabs?  These seem to do nothing and it would be nice to process them in some way. Thanks!

There is no way to change that behavior of the on-prim browser from within the media-content (webpage) or media params. The best you can do is try and direct the link to your script, from which you can bounce the link back at the user to open in a tab or wherever. That's a bit tricky because media doesn't know who's interacting with it, but as a proof of concept:

(not a complete script, boilerplate media stuff removed)

// in the 'webpage' :
<a href="./redir/www.duckduckgo.com"> redirect </a> // the '.' at the front is verfy important.

  // ....
    http_request(key ID, string Method, string Body)
    {   if(ID==ghRequestURL)
        {   gsURL=Body;
            llSetLinkMedia(LINK_THIS,2,
                [   PRIM_MEDIA_HOME_URL, gsURL+"/home", // 'home' is arbitrary, but you must at a minimum add '/' to the end of the suppliued URL in order for local links (href ="./something") to correctly parse back to your prim's namespace.
                    PRIM_MEDIA_CURRENT_URL, gsURL+"/home",
                    PRIM_MEDIA_AUTO_PLAY, TRUE,
                    PRIM_MEDIA_PERMS_CONTROL, PRIM_MEDIA_PERM_NONE, // don't show nav-bar.
                    PRIM_MEDIA_PERMS_INTERACT, PRIM_MEDIA_PERM_NONE // does not actually prevent loading different links, just causes media to reload the previous page after any link is touched. PRIM_MEDIA_PERM_ANYONE would be more sane for this use-case.
                ]);
        }else
        {   string PATH = llGetHTTPHeader(ID,"x-path-info");
            if("/home"==PATH)
            {
                llSetContentType(ID,CONTENT_TYPE_XHTML);
                llHTTPResponse(ID,200,gNCText); // where gNCText is the content of the webpage containing the link
            }else
            {   llHTTPResponse(ID,204,"no content"); // don't confuse the browser.
                if("/redir/"==llGetSubString(PATH,0,6))
                {   llSensor("","",AGENT,7.5,PI); // if only owner can use the media, like a HUD, would not need to sensor.
                    gsURLRedir = "http://"+llDeleteSubString(PATH,0,6);
                }
            }
        }
    }
    sensor(integer n)
    {   while(~--n)
        {   llLoadURL(llDetectedKey(n),"open a new tab?",gsURLRedir);
        }
    }

 

Link to comment
Share on other sites

5 hours ago, Quistess Alpha said:

There is no way to change that behavior of the on-prim browser from within the media-content (webpage) or media params. The best you can do is try and direct the link to your script, from which you can bounce the link back at the user to open in a tab or wherever. That's a bit tricky because media doesn't know who's interacting with it, but as a proof of concept:

(not a complete script, boilerplate media stuff removed)

// in the 'webpage' :
<a href="./redir/www.duckduckgo.com"> redirect </a> // the '.' at the front is verfy important.

  // ....
    http_request(key ID, string Method, string Body)
    {   if(ID==ghRequestURL)
        {   gsURL=Body;
            llSetLinkMedia(LINK_THIS,2,
                [   PRIM_MEDIA_HOME_URL, gsURL+"/home", // 'home' is arbitrary, but you must at a minimum add '/' to the end of the suppliued URL in order for local links (href ="./something") to correctly parse back to your prim's namespace.
                    PRIM_MEDIA_CURRENT_URL, gsURL+"/home",
                    PRIM_MEDIA_AUTO_PLAY, TRUE,
                    PRIM_MEDIA_PERMS_CONTROL, PRIM_MEDIA_PERM_NONE, // don't show nav-bar.
                    PRIM_MEDIA_PERMS_INTERACT, PRIM_MEDIA_PERM_NONE // does not actually prevent loading different links, just causes media to reload the previous page after any link is touched. PRIM_MEDIA_PERM_ANYONE would be more sane for this use-case.
                ]);
        }else
        {   string PATH = llGetHTTPHeader(ID,"x-path-info");
            if("/home"==PATH)
            {
                llSetContentType(ID,CONTENT_TYPE_XHTML);
                llHTTPResponse(ID,200,gNCText); // where gNCText is the content of the webpage containing the link
            }else
            {   llHTTPResponse(ID,204,"no content"); // don't confuse the browser.
                if("/redir/"==llGetSubString(PATH,0,6))
                {   llSensor("","",AGENT,7.5,PI); // if only owner can use the media, like a HUD, would not need to sensor.
                    gsURLRedir = "http://"+llDeleteSubString(PATH,0,6);
                }
            }
        }
    }
    sensor(integer n)
    {   while(~--n)
        {   llLoadURL(llDetectedKey(n),"open a new tab?",gsURLRedir);
        }
    }

 

This looks interesting! But I do not undertstand why an http_request event will occur... ah that's the role of the leading "." in the link?  Hm I wanted a solution that would work for arbitrary html...  Thanks!!!

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...