// Simple, Non-Caching Media URL Updater // by // Moriash Moreau // 8-1-07 // Thanks to nand Nerd for the concept. // This script will continually reload an image using the parcel video stream. Uses fake GET // values to prevent the SL client from caching the image the first time it's loaded. // Drop this script in any object on land you own. If it's on group land, the object must // be deeded to group. Make sure you enable all permissions and check "share with group" for // both this script and the associated object BEFORE deeding the object to group, so that you // can edit this script later, if required. Note that the image will be reloaded from your // webserver each Interval seconds, for each agent on your parcel, for as long as they're there. // Make sure you have the available bandwidth quota on your webserver! // The URL of the actual media you wish to display. Originally intended to display // an image (JPEG, etc.) that continually changes, but keeps the same filename. string MyURL = "http://www.your-domain.com/your-image.jpg"; // Time between image updates. float Interval = 15.0; default { state_entry() { llSetTimerEvent(Interval); } timer() { // Each tick, generate a new dummy URL for the media stream, with two GET parameters // as random numbers. The resulting stream URL will be something like: // "http://www.your-domain.com/your-image.jpg?5786578?432432" // The values after the "?" marks will be ignored by the media player, but the SL // client will cache the media stream based on the full URL. Net result is the // image "your-image.jpg" will not be cached, even though it has the same name // each time it's loaded. So, you can use a simple snapshot-type webcam (or whatever) // that uploads the same filename each time, without SL caching it and refusing to // display the updated image. integer Rand1 = (integer)llFrand(214748364.0); //Come up with two random values. integer Rand2 = (integer)llFrand(214748364.0); //This is probably overkill, but can't hurt! // Now, string it all together as one media URL, and play it. llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_UNLOAD, PARCEL_MEDIA_COMMAND_URL, MyURL + "?" + (string)(Rand1) + "?" + (string)(Rand2), PARCEL_MEDIA_COMMAND_PLAY]); } }