Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Streaming TV or Movie Script - but how to set the parcels Media Texture

Wordfromthe Wise
Cheerless & Sorrowful
Join date: 31 Jan 2007
Posts: 18
07-13-2007 11:58
Hello fellow Scripters. I am working on this script. It actually switches
the parcels Movie URL (after the object is deeded to the group) via
a Menu (LLdialog) but i have 2 questions

First: Why the Parcels default Media Texture dont change ?
(see llParcelMediaCommandList in Line 17 )

and

Second Question: How to LLsay the parcels current Video Stream

Here is the Script (it also has a Submenu but its not 100% ready yet)
(see commented text in line 20)


// simple Select TV Stream from Menu
// ...

integer CHANNEL = 10; // channel to listen to
list MENU_MAIN = ["Movie1", "Movie2", "Movie3", "Movie4", "WEB Channels.."]; // Mainmenu with YOUR prefered Movies
// This works as a Submenu (WebChannels - under construction)
list MENU_OPTIONS = ["WebChannel 1", "WebChannel 2", "WebChannel 3", "WebChannel 4", "WebChannel 5", "WebChannel 6", "..Back"];

default {
state_entry() {
llListen(CHANNEL, "", NULL_KEY, "";); // listens to the Menue (all clicking Group users)

// here i try to set the Lindens Default Media Texture for the parcel
// the ID is correct but it dont work somehow mayby the wrong place in the script for it ?
llParcelMediaCommandList( [PARCEL_MEDIA_COMMAND_TEXTURE, "8b5fec65-8d8d-9dc5-cda8-8fdf2716e361"] );

// i also look for the function to LLSAY the current parcels MovieURL
// anybody in for help?
// llsay(0,????);

}
touch_start(integer total_number)
{
llDialog(llDetectedKey(0), "Select one of your Movies?", MENU_MAIN, CHANNEL); // Shows Main Menu
}

listen(integer channel, string name, key id, string message)
{
if (llListFindList(MENU_MAIN + MENU_OPTIONS, [message]) != -1) // check for Menue
{
llSay(0, name + "now Playing Movie:'" + message + "'.";); // says which of your Movies was selected
if (message == "WEB Channels..";)
llDialog(id, "Select a WEB TV Channel", MENU_OPTIONS, CHANNEL); // shows the Submenu


else if (message == "..Back";)
llDialog(id, "Select on of YOUR Movies", MENU_MAIN, CHANNEL); // shows MainMenu again

else if (message == "Movie1";)

llParcelMediaCommandList( [
PARCEL_MEDIA_COMMAND_URL, "http://www.yourserver.com/yourmovie1.mp4",
PARCEL_MEDIA_COMMAND_TEXTURE, (key) llGetTexture(0) ] );


else if (message == "Movie2";)

llParcelMediaCommandList( [
PARCEL_MEDIA_COMMAND_URL, "http://www.yourserver.com/yourmovie2.mp4",
PARCEL_MEDIA_COMMAND_TEXTURE, (key) llGetTexture(0) ] );



} else
llSay(0, name + " ERROR '" + llToLower(message) + "'.";); // error checking
}
}

Would be nice if somebody can help me on that. I know that there is the
great Freeview out there but its to big for my needs..

Another question (which makes it acually 3 Questions) is: (how) is it possible
to show e.g. a static screen while no movie is playing.

best regards
and thank you in advance

Word (this time not that 'Wise')
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
07-13-2007 13:11
To answer your question(s) in no particular order.
Swap out the media texture on the prim for a static texture when not playing movies using llSetTexture. Then when ready to play a movie switch it back.

The media Texture is set using the command you specified. The only reason that I have found that would prevent it working is permissions, i.e. wrong group. You mention taht AFTER you have deeded the object it works but you are attempting to do so in default state_entry, i..e befor eteh object is deeded. I'd suggest either adding a change handler to allow for when it changes ownership or attempt the change again just prior to playing the movie. This would be required if you swap the texture out for a static picture between films.
_____________________
I'm back......
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
07-13-2007 13:18
What Newgate said (whilst Qie was typing). Also, couple of things with the texture: Reading the wiki, it seems to need an explicit typecast, a la:

llParcelMediaCommandList( [PARCEL_MEDIA_COMMAND_TEXTURE, (key)"8b5fec65-8d8d-9dc5-cda8-8fdf2716e361"] );

Also, just to confirm it's intentional, the dialog responses also change that texture (as well as the URL) in the script as posted.

As for the llSay... I'd try something like

llSay(0, llList2String(llParcelMediaQuery([PARCEL_MEDIA_COMMAND_URL]), 0));

but maybe the question is more involved than that.