Evah Baxton Posted January 31, 2020 Share Posted January 31, 2020 (edited) You have to be the owner of the parcel. You need to have Auto-play Media and Script Auto-play Media enabled for it to behave like in the video. You can stop and start your media, leave the parcel, or logout and log back in and it will re-sync. It will take 1 second to the amount of seconds you have set as the resync period (default 10 seconds). This will override your media link and media texture settings on your parcel. //Evah Baxton 2020 float timerCount=0; integer videoLength=98; //video length in seconds integer resync=10; //resync every 10 seconds string mediaURL = "YOUR MEDIA HERE"; integer loop=1; //loop the synced video integer displayTime=1; //display the seconds elapsed default { state_entry() { llParcelMediaCommandList([ PARCEL_MEDIA_COMMAND_STOP, PARCEL_MEDIA_COMMAND_URL,mediaURL, PARCEL_MEDIA_COMMAND_TEXTURE, (key) llGetTexture(0) ]); } touch_start(integer num_detected) { timerCount=0; llParcelMediaCommandList([ PARCEL_MEDIA_COMMAND_STOP, PARCEL_MEDIA_COMMAND_URL,mediaURL, PARCEL_MEDIA_COMMAND_TEXTURE, (key) llGetTexture(0), PARCEL_MEDIA_COMMAND_TIME, timerCount, PARCEL_MEDIA_COMMAND_PLAY ]); llSetTimerEvent(0.15); } timer() { if(displayTime==1) { llSetText((string)timerCount, <1.0,0,0>,1.0); } if(llGetUnixTime()%resync==0) { timerCount=timerCount+resync; llParcelMediaCommandList([ PARCEL_MEDIA_COMMAND_TIME, timerCount ]); } if(timerCount >= videoLength) { timerCount=0; if(loop==0) { llSetTimerEvent(0.0); } else { llParcelMediaCommandList([ PARCEL_MEDIA_COMMAND_STOP, PARCEL_MEDIA_COMMAND_PLAY ]); } } } } Edited January 31, 2020 by Evah Baxton Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 31, 2020 Share Posted January 31, 2020 Nice work. Do you have a question about it? 1 Link to comment Share on other sites More sharing options...
Evah Baxton Posted January 31, 2020 Author Share Posted January 31, 2020 I was just moving it out of the General Discussion Forum to make it available here. Is there a better place to post working scripts? Link to comment Share on other sites More sharing options...
Rolig Loon Posted January 31, 2020 Share Posted January 31, 2020 (edited) If you've tested it in world and it feels good, put it in the LSL Scripting Library. Edited January 31, 2020 by Rolig Loon 1 1 Link to comment Share on other sites More sharing options...
Alyona Su Posted January 31, 2020 Share Posted January 31, 2020 2 hours ago, Evah Baxton said: You have to be the owner of the parcel. You need to have Auto-play Media and Script Auto-play Media enabled for it to behave like in the video. You can stop and start your media, leave the parcel, or logout and log back in and it will re-sync. It will take 1 second to the amount of seconds you have set as the resync period (default 10 seconds). Just so I understand... this script is placed into the media prim (in your example: into the two televisions)? Link to comment Share on other sites More sharing options...
Evah Baxton Posted January 31, 2020 Author Share Posted January 31, 2020 34 minutes ago, Alyona Su said: Just so I understand... this script is placed into the media prim (in your example: into the two televisions)? Yes. The script sets the parcel's media texture to be the texture from face 0 of the object it is attached to. Link to comment Share on other sites More sharing options...
Evah Baxton Posted January 31, 2020 Author Share Posted January 31, 2020 It needs a good server and a relatively good internet connection. It works much better when the video is smaller. The first time any user plays the media, it takes a moment to sync and buffer from the server. Sometimes it takes two or three syncs to get fully caught up. This public test video has worked well for me:http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/WhatCarCanYouGetForAGrand.mp4 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now