Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

FreeView 1.2 WebGuide - Picture Viewer & Video Control

CrystalShard Foo
1+1=10
Join date: 6 Feb 2004
Posts: 682
07-12-2005 02:58
NOTE: FreeView is NOT FOR RE-SALE.
This script is FREE and OPEN SOURCE and should remain so!


After over a month of work, I am happy to introduce the news version of FreeView:
FreeView 1.2 WebGuide.

What is it?
FreeView is an all-in-one free picture viewer and video control script.

FreeView can both display your favorate pictures and textures from within secondlife, AND display your video streams with ease.

FreeView includes advance controls in both modes that turn it into a complete product that rivals the commercial products in the market today.

Whats new:
This version includes several small tweaks and modifications, and one major new feature. As of version 1.2, FreeView now features a fully functional web-based stream guide!

FlipperPA Pergerine has been working on this site for quite awhile, and it is now ready for the public: This guide acts as a web-based index to online streams, flash and quicktime movies.

You can easily browse among the choices of video streams online via a comfortable web interface, sorted by categories with detailed descriptions, and even a "Maturity" level to help you distinguish if that certain video is going to be PG or Mature.

Thanks for its design for integration with FreeView, clicking any of the URLs will immidiatly update your FreeView television with the stream, allowing you to watch it right away.

If you have any good links to streams, movies, or flash files that you would like to share, please submit their URLs to the guide for inclusion. Once approved, they will show up in the guide for other people to see!

Additional changes:
- Added constants for changing PRIM_MATERIAL variables to other type of materials incase the user prefer not to use Light (Please note: FreeView will color side 0 of the object into pure black to prevent Light rendering lag. I have tested this and it does seem to do the job nicely).

- FreeView will now save the texture offset, repeat and rotation when changing display modes. (Thanks goes to Christopher Omega for the idea)

- FreeView will now check if the bookmarks notecard key has been changed before calling the Dataserver for an update on the number of notecard lines when the contents of FreeView change.

- Additional minor changes

Where can I get it?
FreeView is available at the following sources:

- This thread (duh)
- My shop: Script-Foo at Apukohai (167, 22)
- SLBoutique (click to link straight to the FreeView product page)


Thats it for the introduction. Onward to the code!
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
07-12-2005 06:58
This thread is effectively closed until CrystalShard posts the script, at which point the discussion thread will be created per the usual.
_____________________
i've got nothing. ;)
CrystalShard Foo
1+1=10
Join date: 6 Feb 2004
Posts: 682
07-12-2005 08:14
Usage:
This script can work on its own on private and group parcels.

However, to use the WebGuide feature on group deeded parcels, you must use the FreeView Remote - to be posted after this script. Please refer to the documentation at http://www.slguide.com/help for additional help if necessary.

SCRIPT: FreeView 1.2 WebGuide
CODE

//FreeView 1.2 WebGuide (revision 3) - By CrystalShard Foo
//Multifunctional Picture viewer and Video control script with webguide support
//This script is distributed for free and must stay that way.

// *** DO NOT SELL THIS SCRIPT UNDER ANY CIRCUMSTANCE. ***

//Help for using this script can be obtained at: http://www.slguide.com/help

//Feel free to modify this script and post your improvement. Leave the credits intact but feel free to add your name at its bottom.

//Whats new:
//- Now using FULL_BRIGHT instead of PRIM_MATERIAL_LIGHT for the screen display
//- Added an ownership-change code to handle cases where FreeView gets deeded to group post Video Init.
//- Renamed WebGuide to TV-Guide to reflect what this thing does better.
//- Added a 'Fix Scale' button to Picture mode to help against user texture-scale changes.
//- Additional minor help-tips and code improvements

//Enjoy!


//Constants
integer PICTURE_ROTATION_TIMER = 30; //In whole seconds

integer DISPLAY_ON_SIDE = ALL_SIDES; //Change this to change where the image will be displayed

key VIDEO_DEFAULT = "71b8ff26-087d-5f44-285b-d38df2e11a81"; //Test pattern - Used as default video texture when one is missing in parcel media
key BLANK = "5748decc-f629-461c-9a36-a35a221fe21f"; //Blank texture - Used when there are no textures to display in Picture mode
string NOTECARD = "bookmarks"; //Used to host URL bookmarks for video streams

integer VIDEO_BRIGHT = TRUE; //FULL_BRIGHT status for Video
integer PICTURE_BRIGHT = TRUE; //FULL_BRIGHT status for Picture

integer REMOTE_CHANNEL = 9238742;

integer mode = 0; //Freeview mode.
//Mode 0 - Power off
//Mode 1 - Picture viewer
//Mode 2 - Video

integer listenHandle = -1; //Dialog menu listen handler
integer listenUrl = -1; //listen handler for channel 1 for when a URL is being added
integer listenTimer = -1; //Timer variable for removing all listeners after 2 minutes of listener inactivity
integer listenRemote = -1; //listen handler for the remote during initial setup
integer encryption = 0;
integer numberofnotecardlines = 0; //Stores the current number of detected notecard lines.
integer notecardline = 0; //Current notecard line

integer loop_image = FALSE; //Are we looping pictures with a timer? (picture mode)
integer current_texture = 0; //Current texture number in inventory being displayed (picture mode)
integer chan; //llDialog listen channel
integer notecardcheck = 0;
key video_texture; //Currently used video display texture for parcel media stream

string moviename;
string tempmoviename;
key notecardkey = NULL_KEY;
key tempuser; //Temp key storge variable
string tempurl; //Temp string storge variable

integer isGroup = TRUE;
key groupcheck = NULL_KEY;
key last_owner;
key XML_channel;

pictures() //Change mode to Picture Viewer
{
//Initilize variables

//Change prim to Light material while coloring face 0 black to prevent light-lag generation.
llSetPrimitiveParams([PRIM_BUMP_SHINY, DISPLAY_ON_SIDE, PRIM_SHINY_NONE, PRIM_BUMP_NONE, PRIM_COLOR, DISPLAY_ON_SIDE, <1,1,1>, 1.0, PRIM_MATERIAL, PRIM_MATERIAL_PLASTIC, PRIM_FULLBRIGHT, DISPLAY_ON_SIDE, PICTURE_BRIGHT]);

integer check = llGetInventoryNumber(INVENTORY_TEXTURE);

if(check == 0)
{
report("No pictures found.");
llSetTexture(BLANK,DISPLAY_ON_SIDE);
return;
}
else
if(current_texture > check)
//Set to first texture if available
current_texture = 0;

display_texture(current_texture);
}

video() //Change mode to Video
{
//Change prim to Light material while coloring face 0 black to prevent light-lag generation.
llSetPrimitiveParams([PRIM_BUMP_SHINY, DISPLAY_ON_SIDE, PRIM_SHINY_NONE, PRIM_BUMP_NONE, PRIM_COLOR, DISPLAY_ON_SIDE, <1,1,1>, 1.0, PRIM_MATERIAL, PRIM_MATERIAL_PLASTIC, PRIM_FULLBRIGHT, DISPLAY_ON_SIDE, VIDEO_BRIGHT, PRIM_TEXTURE, DISPLAY_ON_SIDE, "62dc73ca-265f-7ca0-0453-e2a6aa60bb6f", llGetTextureScale(DISPLAY_ON_SIDE), llGetTextureOffset(DISPLAY_ON_SIDE), llGetTextureRot(DISPLAY_ON_SIDE)]);

report("Video mode"+moviename+": Stopped");
if(finditem(NOTECARD) != -1)
tempuser = llGetNumberOfNotecardLines(NOTECARD);
video_texture = llList2Key(llParcelMediaQuery([PARCEL_MEDIA_COMMAND_TEXTURE]),0);
if(video_texture == NULL_KEY)
{
video_texture = VIDEO_DEFAULT;
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_TEXTURE,VIDEO_DEFAULT]);
llSay(0,"No parcel media texture found. Setting texture to default: "+(string)VIDEO_DEFAULT);
if(llGetLandOwnerAt(llGetPos()) != llGetOwner())
llSay(0,"Error: Cannot modify parcel media settings. "+llGetObjectName()+" is not owned by parcel owner.");
}

llSetTexture(video_texture,DISPLAY_ON_SIDE);
}

off()
{
report("Click to power on.");
llSetPrimitiveParams([PRIM_BUMP_SHINY, DISPLAY_ON_SIDE, PRIM_SHINY_LOW, PRIM_BUMP_NONE, PRIM_COLOR, DISPLAY_ON_SIDE, <0.1,0.1,0.1>, 1.0,PRIM_MATERIAL, PRIM_MATERIAL_PLASTIC, PRIM_FULLBRIGHT, DISPLAY_ON_SIDE, FALSE, PRIM_TEXTURE, DISPLAY_ON_SIDE, BLANK, llGetTextureScale(DISPLAY_ON_SIDE), llGetTextureOffset(DISPLAY_ON_SIDE), llGetTextureRot(DISPLAY_ON_SIDE)]);
}

integer finditem(string name) //Finds and returns an item's inventory number
{
integer i;
for(i=0;i<llGetInventoryNumber(INVENTORY_NOTECARD);i++)
if(llGetInventoryName(INVENTORY_NOTECARD,i) == NOTECARD)
return i;
return -1;
}

seturl(string url, key id) //Set parcel media URL
{
if(mode != 2)
{
video();
mode = 2;
}
moviename = tempmoviename;
if(moviename)
moviename = " ["+moviename+"]";
tempmoviename = "";
string oldurl = llList2String(llParcelMediaQuery([PARCEL_MEDIA_COMMAND_URL]),0);
if(oldurl != "")
llOwnerSay("Setting new media URL. The old URL was: "+oldurl);

llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,url]);
if(id!=NULL_KEY)
menu(id);
else
{
report("Video mode"+moviename+": Playing");
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_PLAY]);
}

if(isGroup)
llSay(0,"New media URL set.");
else
llOwnerSay("New media URL set: "+url);
}

string mediatype(string ext) //Returns a string stating the filetype of a file based on file extension
{
ext = llToLower(ext);
if(ext == "swf")
return "Flash";
if(ext == "mov" || ext == "avi" || ext == "mpg" || ext == "mpeg" || ext == "smil")
return "Video";
if(ext == "jpg" || ext == "mpeg" || ext == "gif" || ext == "png" || ext == "pict" || ext == "tga" || ext == "tiff" || ext == "sgi" || ext == "bmp")
return "Image";
if(ext == "txt")
return "Text";
if(ext == "mp3" || ext == "wav")
return "Audio";
return "Unknown";
}

browse(key id) //Image browser function for picture viewer mode
{
integer check = llGetInventoryNumber(INVENTORY_TEXTURE);
string header;
if(check > 0)
header = "("+(string)(current_texture+1)+"/"+(string)check+") "+llGetInventoryName(INVENTORY_TEXTURE,current_texture);
else
header = "No pictures found.";
llDialog(id,"** Monitor Control **\n Picture Viewer mode\n- Image browser\n- "+header,["Back","Next","Menu"],chan);
extendtimer();
}

report(string str)
{
llSetObjectDesc(str);
}

extendtimer() //Add another 2 minute to the Listen Removal timer (use when a Listen event is triggered)
{
if(listenHandle == -1)
listenHandle = llListen(chan,"","","");
listenTimer = (integer)llGetTime() + 120;
if(loop_image == FALSE)
llSetTimerEvent(45);
}

config(key id) //Configuration menu
{
extendtimer();
llDialog(id,"Current media URL:\n"+llList2String(llParcelMediaQuery([PARCEL_MEDIA_COMMAND_URL]),0)+"\nTip: If the picture is abit off, try 'Align ON'",["Set URL","Align ON","Align OFF","Menu","Set Remote"],chan);
}

tell_remote(string str)
{
llShout(REMOTE_CHANNEL,llXorBase64Strings(llStringToBase64((string)encryption + str), llStringToBase64((string)encryption)));
}

menu(key id) //Dialog menus for all 3 modes
{
list buttons = [];
string title = "** Monitor control **";

extendtimer();

if(mode != 0)
{
if(mode == 1) //Pictures menu
{
title+="\n Picture Viewer mode";
buttons+=["Browse"];
if(loop_image == FALSE)
buttons+=["Loop"];
else
buttons+=["Unloop"];
buttons+=["Video","Power off","Help","Fix scale"];
}
else //Video menu
{
title+="\n Video display mode\n"+moviename+"\nTip:\nClick 'TV Guide' to view the Online bookmarks.";
buttons+=["Pictures","Configure","Power off","Loop","Unload","Help","Play","Stop","Pause","TV Guide","Bookmarks","Set URL"];
}
}
else
buttons += ["Pictures","Video","Help"];

llDialog(id,title,buttons,chan);
}

display_texture(integer check) //Display texture and set name in description (picture mode)
{ //"Check" holds the number of textures in contents. The function uses "current_texture" to display.
string name = llGetInventoryName(INVENTORY_TEXTURE,current_texture);
llSetTexture(name,DISPLAY_ON_SIDE);
report("Showing picture: "+name+" ("+(string)(current_texture+1)+"/"+(string)check+")");
}


next() //Change to next texture (picture mode)
{ //This function is used twice - by the menu and timer. Therefor, it is a dedicated function.
current_texture++;
integer check = llGetInventoryNumber(INVENTORY_TEXTURE);
if(check == 0)
{
llSetTexture(BLANK,DISPLAY_ON_SIDE);
current_texture = 0;
report("No pictures found.");
return;
}
if(check == current_texture)
current_texture = 0;

display_texture(check);
return;
}

default
{
state_entry()
{
chan = (integer)llFrand(1000) + 1000; //Pick a random listen channel for the listener
if(PICTURE_ROTATION_TIMER <= 0) //Ensure the value is no less or equal 0
PICTURE_ROTATION_TIMER = 1;
llListenRemove(listenHandle);
listenHandle = -1;
last_owner = llGetOwner();
groupcheck = llRequestAgentData(llGetOwner(),DATA_NAME);
off();
llOpenRemoteDataChannel();
}

on_rez(integer i)
{
llResetScript();
}

touch_start(integer total_number)
{
//-------------------------------------------------------------------------------
//Listen only to owner or group member. Edit this code to change access controls.
if(llDetectedKey(0) != llGetOwner() && llDetectedGroup(0) == FALSE)
return;
//-------------------------------------------------------------------------------

if(llGetOwnerKey(llGetKey()) != last_owner) //Sense if object has been deeded to group for Web Guide function
{
isGroup = TRUE;
last_owner = llGetOwner();
groupcheck = llRequestAgentData(llGetOwner(),DATA_NAME);

if(mode == 2)
{
llSay(0,"Detected change in ownership. Attempting to obtain current parcel media texture...");
video();
}
}

menu(llDetectedKey(0));
}

changed(integer change)
{
if(change == CHANGED_INVENTORY) //If inventory change
if(mode == 1) //If picture mode
{
integer check = llGetInventoryNumber(INVENTORY_TEXTURE);
if(check != 0)
{
current_texture = 0;
display_texture(check);
}
else
{
llSetTexture(BLANK,DISPLAY_ON_SIDE);
report("No pictures found.");
}
}
else
if(mode == 2) //If video mode
if(finditem(NOTECARD) != -1) //And bookmarks notecard present
if(notecardkey != llGetInventoryKey(NOTECARD))
tempuser = llGetNumberOfNotecardLines(NOTECARD); //Reload number of lines
}

listen(integer channel, string name, key id, string message)
{
if(message == "Pictures")
{
if(mode == 2)
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_STOP]);
pictures();
mode = 1;
menu(id);
return;
}
if(message == "Video")
{
video();
mode = 2;
menu(id);
return;
}
if(message == "Power off")
{
if(mode == 2)
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_UNLOAD]);
off();
mode = 0;
return;
}
if(message == "Help")
{
llSay(0,"Help documentation is available at: http://www.slguide.com/help");
if(isGroup)
{
if(id == NULL_KEY)
{
llSay(0,"FreeView cannot load help pages while set to group without the remote.");
llSay(0,"For further assistance, please consult: http://slguide.com/help");
}
else
tell_remote("HELP"+(string)id+(string)XML_channel);
}
else
llLoadURL(id,"Help pages for FreeView","http://www.slguide.com?c="+(string)XML_channel+"&help=1");
}
if(mode == 1)
{
if(message == "Browse")
{
loop_image = FALSE;
browse(id);
return;
}
if(message == "Next")
{
extendtimer();
next();
browse(id);
}
if(message == "Back")
{
extendtimer();
current_texture--;
integer check = llGetInventoryNumber(INVENTORY_TEXTURE);
if(check == 0)
{
llSetTexture(BLANK,DISPLAY_ON_SIDE);
current_texture = 0;
report("No pictures found.");
return;
}
if(current_texture < 0)
current_texture = check - 1;

display_texture(check);

browse(id);
return;
}
if(message == "Menu")
{
menu(id);
return;
}
if(message == "Loop")
{
llSetTimerEvent(PICTURE_ROTATION_TIMER);
loop_image = TRUE;
llOwnerSay("Picture will change every "+(string)PICTURE_ROTATION_TIMER+" seconds.");
return;
}
if(message == "Unloop")
{
loop_image = FALSE;
llOwnerSay("Picture loop disabled.");
return;
}
if(message == "Fix scale")
{
llSay(0,"Setting display texture to 1,1 repeats and 0,0 offset.");
llScaleTexture(1, 1, DISPLAY_ON_SIDE);
llOffsetTexture(0, 0, DISPLAY_ON_SIDE);
return;
}
}
if(mode == 2)
{
if(channel == REMOTE_CHANNEL)
{
if(encryption == 0)
encryption = (integer)message;
llListenRemove(listenRemote);
listenRemote = -1;
llSay(0,"Remote configured ("+(string)id+")");
}

if(message == "TV Guide")
{
if(isGroup)
{
if(!encryption)
{
llSay(0,"** Error - This FreeView object has been deeded to group. You must use a Remote control to open the TV Guide.");
llSay(0,"You can set up the remote control from the Video -> Configuration menu. Please refer to the notecard for further assistance.");
return;
}
tell_remote((string)id+(string)XML_channel+(string)llGetOwner());
}
else
llLoadURL(id, "Come to the Guide to Start Your Viewer Playing!", "http://slguide.com/index.php?v=" + (string)llGetKey() + "&c=" + (string)XML_channel + "&o=" + (string)llGetOwner() + "&");
return;
}

string header = "Video mode"+moviename+": ";

if(message == "<< Prev")
{
notecardline--;
if(notecardline < 0)
notecardline = numberofnotecardlines - 1;
tempuser = id;
llGetNotecardLine(NOTECARD,notecardline);
return;
}
if(message == "Next >>")
{
notecardline++;
if(notecardline >= numberofnotecardlines)
notecardline = 0;
tempuser = id;
llGetNotecardLine(NOTECARD,notecardline);
return;
}
if(message == "Use")
{
if(tempurl == "** No URL specified! **")
tempurl = "";
seturl(tempurl,id);
return;
}

if(message == "Menu")
{
menu(id);
return;
}
if(message == "Configure")
{
config(id);
return;
}
if(message == "Bookmarks")
{
if(notecardcheck != -1)
{
llDialog(id,"Error: No valid bookmark data found in notecard '"+NOTECARD+"'.",["Menu"],chan);
return;
}
if(finditem(NOTECARD) != -1)
{
tempuser = id;
if(numberofnotecardlines < notecardline)
notecardline = 0;
llGetNotecardLine(NOTECARD,notecardline);
}
else
llDialog(id,"Error: No notecard named "+NOTECARD+" found in contents.",["Menu"],chan);
return;
}

if(llGetLandOwnerAt(llGetPos()) != llGetOwner()) //If we do not have permissions to actually do the following functions
{
llSay(0,"Error: Cannot modify parcel media settings. "+llGetObjectName()+" is not owned by parcel owner.");
menu(id);
return; //Abort
}

if(listenUrl != -1 && channel == 1) //Incoming data from "Set URL" command (user spoke on channel 1)
{
llListenRemove(listenUrl);
listenUrl = -1;
tempmoviename = "";
seturl(message,id);
}
if(message == "Play")
{
report(header+"Playing");
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_PLAY]);
return;
}
if(message == "Stop")
{
report(header+"Stopped");
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_STOP]);
return;
}
if(message == "Pause")
{
report(header+"Paused");
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_PAUSE]);
return;
}
if(message == "Unload")
{
report(header+"Stopped");
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_UNLOAD]);
return;
}
if(message == "Loop")
{
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_LOOP]);
return;
}
//URL , Auto-Scale,
if(message == "Set URL")
{
report(header+"Stopped");
listenUrl = llListen(1,"",id,"");
llDialog(id,"Please type the URL of your choice with /1 in thebegining. For example, /1 www.google.com",["Ok"],938);
return;
}
if(message == "Align ON")
{
report(header+"Stopped");
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_AUTO_ALIGN,TRUE]);
menu(id);
return;
}
if(message == "Align OFF")
{
report(header+"Stopped");
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_AUTO_ALIGN,FALSE]);
menu(id);
return;
}
if(message == "Set Remote")
{
llSay(0,"Configuring remote...");
encryption = 0;
llListenRemove(listenRemote);
listenRemote = llListen(REMOTE_CHANNEL,"","","");
llSay(REMOTE_CHANNEL,"SETUP");
}
}
}

dataserver(key queryid, string data)
{
if(queryid == groupcheck) //Test if object is deeded to group
{
groupcheck = NULL_KEY;
isGroup = FALSE;
return;
}

if(queryid == tempuser) //If just checking number of notecard lines
{
numberofnotecardlines = (integer)data;
notecardkey = llGetInventoryKey(NOTECARD);
notecardcheck = 0;
llGetNotecardLine(NOTECARD,notecardcheck);
return;
}
if(notecardcheck != -1)
{
if(data != EOF)
{
if(data == "")
{
notecardcheck++;
llGetNotecardLine(NOTECARD,notecardcheck);
}
else
{
notecardcheck = -1;
return;
}
}
else
return;
}

if(data == "" && notecardline < numberofnotecardlines) //If user just pressed "enter" in bookmarks, skip
{
notecardline++;
llGetNotecardLine(NOTECARD,notecardline);
return;
}

if(data == EOF)
{
notecardline = 0;
llGetNotecardLine(NOTECARD,notecardline);
return;
}
list parsed = llParseString2List(data,["|","| "," |"," | "],[]); //Ensure no blank spaces before "http://".
string name = llList2String(parsed,0);
tempurl = llList2String(parsed,1);
if(tempurl == "")
tempurl = "** No URL specified! **";

tempmoviename = name;

llDialog(tempuser,"Bookmarks notecard ("+(string)(notecardline+1)+"/"+(string)numberofnotecardlines+")\n"+name+" ("+mediatype(llList2String(llParseString2List(tempurl,["."],[]),-1))+")\n"+tempurl,["<< Prev","Use","Next >>","Menu"],chan);
}

remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval)
{
if (type == REMOTE_DATA_CHANNEL)
{
XML_channel = channel;
}
else if(type == REMOTE_DATA_REQUEST)
{
list media_info = llParseString2List(sval, ["|"], []);
tempmoviename = llList2String(media_info,0);
seturl(llList2String(media_info,1),NULL_KEY);
llRemoteDataReply(channel, message_id, sval, 1);
}
}

timer()
{
if(llGetTime() > listenTimer) //If listener time expired...
{
llListenRemove(listenHandle); //Remove listeneres.
llListenRemove(listenUrl);
llListenRemove(listenRemote);
listenHandle = -1;
listenUrl = -1;
listenRemote = -1;
listenTimer = -1;
if(loop_image == FALSE || mode != 1) //If we're not looping pictures or are in picture mode at all
llSetTimerEvent(0.0); //Remove timer
}

if(loop_image == TRUE && mode == 1) //If we're looping pictures and and we're in picture mode...
next(); //Next picture
}
}
CrystalShard Foo
1+1=10
Join date: 6 Feb 2004
Posts: 682
07-12-2005 08:19
The following is the FreeView Remote script that can be used to enable WebGuide support on group-deeded parcels.

This is necessary because group-deeded objects CANNOT use llLoadURL!

To use this script, put it in an object that will not be auto-returned, and do not deed it to group. Deeding this object will defeat the cause.

Please refer to the help documentation at http://www.slguide.com/help for additional help if necessary.

SCRIPT: FreeView Remote [DROP ME IN ANOTHER OBJECT! Do NOT group deed!]
CODE

//This script allow Group-Deeded FreeView to work on group deeded land.

//DO NOT PUT IN THE SAME OBJECT AS THE FREEVIEW VIEWER

//DO NOT DEED THIS OBJECT TO GROUP

integer CHANNEL = 9238742;
integer code = 0;

default
{
state_entry()
{
llSetText("~FreeView Remote for Group land~\nConfigure me!\nClick the FreeView TV: Video -> Configure -> Set Remote",<1,1,1>,1);
llListen(CHANNEL,"","","");
llRequestAgentData(llGetLandOwnerAt(llGetPos()),DATA_NAME);
}

on_rez(integer i)
{
llResetScript();
}

listen(integer channel, string name, key id, string message)
{
if(message == "SETUP" && code == 0)
{
llSetText("",<1,1,1>,1);
code = (integer)llFrand(2100000);
code+=1;
llSay(CHANNEL,(string)code);
llSleep(2);
llSay(0,"Done! Please keep me somewhere near your FreeView object. Additionaly, you can modify my shape and texture if you wish.");
}
message = llBase64ToString(llXorBase64Strings(message, llStringToBase64((string)code)));
integer length = llStringLength((string)code);
if(llGetSubString(message,0,length - 1) != (string)code)
return;

message = llGetSubString(message,length,-1);

if(llGetSubString(message,0,3) == "HELP")
{
llLoadURL((key)llGetSubString(message,4,39),"The FreeView help pages.","http://www.slguide.com/index.php?c="+llGetSubString(message,40,-1)+"&help=1");
}
else
{
if(llStringLength(message) == 108)
llLoadURL((key)llGetSubString(message,0,35), "Come to the Guide to Start Your Viewer Playing!", "http://www.slguide.com/index.php?v=" + (string)llGetKey() + "&c=" + llGetSubString(message,36,71) + "&o=" + llGetSubString(message,72,-1) + "&");
}
}

dataserver(key queryid, string data)
{
if(data!="" && data != NULL_KEY)
{
llSetText("This land is not deeded to group.\nFeel free to delete me.",<1,1,1>,1);
llSay(0,"You do not need to use this Remote because this land is not owned by group. (It is owned by: "+data+").");
}
}
}
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
07-12-2005 08:21
/15/d3/53495/1.html
_____________________
i've got nothing. ;)
splat1 Edison
Registerd Nut
Join date: 6 Sep 2004
Posts: 353
07-12-2005 09:17
Wee nice one hats off to you :)
_____________________
Splat Soft - We exsist in the RL to!
Gigas Bunny (Mule)
####
You see, our experts describe you as an appallingly dull fellow, unimaginative, timid, lacking in initiative, spineless, easily dominated, no sense of humour, tedious company and irrepressibly drab and awful. And whereas in most professions these would be considerable drawbacks, in chartered accountancy they are a positive boon.
Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
07-12-2005 09:20
Bravo Crystal & Flip! Well done :)

Cant wait to get home & try this out! :cool:
_____________________
----------------------------------------------------------
--The mind's eye is limited only by its focus--
FlipperPA Peregrine
Magically Delicious!
Join date: 14 Nov 2003
Posts: 3,703
07-12-2005 09:22
It was VERY cool to work on this project with CrystalShard. While video has been a neat "toy" in Second Life, its utility has been offset by what a pain in the arse it is to keep decent streams! This will give us a centralized database of content.

I was also kind of irritated by people selling notecards with URLs to other peoples sites for thousands of Linden dollars. This site will hopefully put an end to that, and let us all share our streams!

We have some ideas for the future as well, but I'll keep them silent for now. Just rest assured, more features will come.

Enjoy, and feel free to post any comments / suggestions / criticism in this thread.

We hope you enjoy FreeView!

-Flip
_____________________
Peregrine Salon: www.PeregrineSalon.com - my consulting company
Second Blogger: www.SecondBlogger.com - free, fully integrated Second Life blogging for all avatars!
Snakeye Plisskin
Registered User
Join date: 8 Apr 2005
Posts: 153
07-12-2005 18:28
I get an error when trying to compile this in SL.

(58, 78) : ERROR : Syntax error
CrystalShard Foo
1+1=10
Join date: 6 Feb 2004
Posts: 682
07-12-2005 21:11
The forums cause some errors in all-caps constant words like "PRIM_MATERIAL". It adds blank spaces in various spots.

If you see that the syntax error is pointing at an all-caps word with a big blank space, try to remove it manualy.

Alternativly, you can "order" a copy from the SLBoutique page listed above.
Snakeye Plisskin
Registered User
Join date: 8 Apr 2005
Posts: 153
07-13-2005 07:44
Thanks for the heads up, i'll check this out when I get back from work. ;)
FlipperPA Peregrine
Magically Delicious!
Join date: 14 Nov 2003
Posts: 3,703
07-18-2005 18:57
We're close to tweaking the webguide to a state where multiple viewers can help moderate with passwords.

More features are en route as well.

Regards,

-Flip
_____________________
Peregrine Salon: www.PeregrineSalon.com - my consulting company
Second Blogger: www.SecondBlogger.com - free, fully integrated Second Life blogging for all avatars!
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
07-18-2005 20:39
Thank you.

This is awesome. I found how useful a fully functional web-based stream guide feature was. :) It is so easy that I can change URL of my land. Great! :)
_____________________
:) Seagel Neville :)
Kyrah Abattoir
cruelty delight
Join date: 4 Jun 2004
Posts: 2,786
07-18-2005 21:46
yes this rock , 3 thumbs up for FLipper and Crystal !!

and you two made me addicted to old comedies!
_____________________

tired of XStreetSL? try those!
apez http://tinyurl.com/yfm9d5b
metalife http://tinyurl.com/yzm3yvw
metaverse exchange http://tinyurl.com/yzh7j4a
slapt http://tinyurl.com/yfqah9u
Rendal Lamington
Registered User
Join date: 16 Jul 2005
Posts: 2
07-21-2005 19:23
OK question, what extensions is this compatable with? and how to you load files directly? I'm assuming ti works on a notecard system but don't know how those work.
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
07-22-2005 07:47
From: Rendal Lamington
OK question, what extensions is this compatable with?
I guess it owes Quicktime's spec. Is this right?
_____________________
:) Seagel Neville :)
Fushichou Mfume
Registered User
Join date: 30 Jul 2005
Posts: 182
08-17-2005 13:21
To Crystalshard and Flip: thank you. I've been tearing my hair out trying to get some kind of video to work on our property which is group-owned. One TV I bought actually had your script in it, but of course the TV object was set to no-mod which prevents you from actually using the script except in the most rudimentary manner. (For example, I couldn't load the object with pictures for the slide show feature.)

I visited your in-game plot, grabbed the freebie and had it set up in about 3 minutes and working great. I also bought your hangman game, lol and will be going back for the Frag-Foo soon.

Even though there isn't boo out there for decent movies in Quicktime format (will LL ever support WMV?), your web-based guide page is wonderful. If I ever find good URLs you can bet I'll be adding them to your guide.

Thanks for the effort and the job well done.
a lost user
Join date: ?
Posts: ?
08-17-2005 19:16
Try the SL Video Bank in Grizedale (133, 122)

They have a bunch of videos you can buy or rent to use on your land. Most of them have been optimised to use in the game, so you don't end up with these super huge files that takes ages to buffer, and everyone can enjoy them.
Cyberwolf Kirkorian
Registered User
Join date: 18 Jan 2006
Posts: 1
Specifications of streams and video?
03-17-2006 10:23
Hi,

Im pretty new to video in SL.

What kind of streaming video formats does SL/FreeView support and what size/resolution do you recommend so the quality is optimum but it still looks good and downloads fast?

Cheerio, Cyberwolf
Jystone Marlowe
Registered User
Join date: 6 May 2005
Posts: 7
bookmark note card
05-15-2006 16:50
Ok first off, much respect for all the work yous have done and distributing this for free! :D

Ok, my question:
I want to use a "bookmark" note card and distribute my own video URLs...
I figured this:

string NOTECARD = "bookmarks"; //Used to host URL bookmarks for video streams

is what i would utilize for such a thing?

Anyways i dropped a note card, named "bookmarks" into the prim with your script, listing 5 URLs, entering URLs only, like so, (just an example)...
http://www.example.com/1.mov
http://www.example.com/2.mov
http://www.example.com/3.mov
etc, etc

When i click on "bookmarks" on the menu i get this following message...
Bookmark's notecard (1/5)
http://www.example.com/1.mov (unknown)
** No URL Specified! **

Then it leaves the Video URL blank.
Just wondering what im doing wrong or if i have missed a step.

Thanx!
Jy
Whiplash Plasma
Registered User
Join date: 24 Jan 2006
Posts: 6
Bookmark format
05-30-2006 21:37
From: Jy
When i click on "bookmarks" on the menu i get this following message...
Bookmark's notecard (1/5)
[url=
http://www.example.com/1.mov (unknown)
** No URL Specified! **

Then it leaves the Video URL blank.
Just wondering what im doing wrong or if i have missed a step.

Thanx!
Jy
[/url]

I just ran into this same issue. It turns out that Freeview is expecting a specific format within the bookmarks. This format is:

<title or description>|<valid URL>

Of course, you don't include the angle brackets. You were missing the first part of each line, i.e. a description followed by a vertical bar. Then you put your URL. When I added that to each line in the bookmark, suddenly all my videos played fine.

Hope this helps.
CaptJosh Au
Registered User
Join date: 20 May 2006
Posts: 5
11-07-2006 02:15
Sorry to engage in thread necromancy, but I'm looking to possibly alter this script to have a user list so that only specified users can engage the remote, but I'm not sure of how to do that. I've looked at another script or two I have on hand that make use of user lists, but I'm not sure how to incorporate this behavior without breaking the script. Any assistance would be helpful.