Difference between revisions of "Youtube TV"

From Second Life Wiki
Jump to navigation Jump to search
(Not currently working)
Line 1: Line 1:
'''Note: these scripts rely on a private external server, http://secondtools.ismywebsite.com/youtube/getvideotext.php.  On 10/15/09, I tried it and that server isn't returning anything meaningful.'''
To make a YouTube TV you only need 2 scripts, each one in one prim:
To make a YouTube TV you only need 2 scripts, each one in one prim:



Revision as of 10:34, 15 October 2009

Note: these scripts rely on a private external server, http://secondtools.ismywebsite.com/youtube/getvideotext.php. On 10/15/09, I tried it and that server isn't returning anything meaningful.

To make a YouTube TV you only need 2 scripts, each one in one prim:

Get Video.lsl <lsl> integer listenid;

default {

   touch_start(integer i)
   {
       if(llDetectedKey(0) == llGetOwner())
       {
           llOwnerSay("Please type: /65 (Youtube video id) Example: Video URL: http://youtube.com/video?v=blablabla Video ID: blablabla");
           listenid = llListen(65, "", llGetOwner(),"");
       }
   }
   listen(integer c, string n, key k, string m)
   {
       llListenRemove(listenid);
       if(k == llGetOwner())
       {
           llHTTPRequest("http://secondtools.ismywebsite.com/youtube/getvideotext.php?v="+m,[],"");
       }
   }
   http_response(key requestid, integer status, list metadata, string body)
   {
       llOwnerSay("Connecting...");
       llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,body]);
   }

} </lsl>

Get Texture.lsl <lsl> default {

   state_entry()
   {
       
   }
   
   touch_start(integer i)
   {
       if(llDetectedKey(0) == llGetOwner())
       {
           llOwnerSay("Getting Parcel Media Texture...");
           string landTexture;
           landTexture = (string) llParcelMediaQuery([PARCEL_MEDIA_COMMAND_TEXTURE]);
           llSetTexture(landTexture,ALL_SIDES);
       }
   }

} </lsl>

Now is only sit and watch your favorite Youtube videos!