summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerparcelmedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerparcelmedia.cpp')
-rw-r--r--indra/newview/llviewerparcelmedia.cpp59
1 files changed, 44 insertions, 15 deletions
diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp
index de37ce253e..2b475ce9f9 100644
--- a/indra/newview/llviewerparcelmedia.cpp
+++ b/indra/newview/llviewerparcelmedia.cpp
@@ -41,6 +41,7 @@
#include "lluuid.h"
#include "message.h"
#include "llviewerparcelmediaautoplay.h"
+#include "llviewerwindow.h"
#include "llfirstuse.h"
// Static Variables
@@ -48,6 +49,9 @@
S32 LLViewerParcelMedia::sMediaParcelLocalID = 0;
LLUUID LLViewerParcelMedia::sMediaRegionID;
+// Local functions
+void callback_play_media(S32 option, void* data);
+
// Move this to its own file.
// helper class that tries to download a URL from a web site and calls a method
// on the Panel Land Media and to discover the MIME type
@@ -152,6 +156,14 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
LLViewerMedia::setMimeType(parcel->getMediaType());
}
+ // First use warning
+ if( gSavedSettings.getWarning("FirstStreamingVideo") )
+ {
+ gViewerWindow->alertXml("ParcelCanPlayMedia",
+ callback_play_media, (void*)parcel);
+
+ }
+
}
}
else
@@ -274,7 +286,8 @@ void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg
}
else
// play
- if( command == PARCEL_MEDIA_COMMAND_PLAY )
+ if(( command == PARCEL_MEDIA_COMMAND_PLAY ) ||
+ ( command == PARCEL_MEDIA_COMMAND_LOOP ))
{
if (LLViewerMedia::isMediaPaused())
{
@@ -287,16 +300,6 @@ void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg
}
}
else
- // loop
- if( command == PARCEL_MEDIA_COMMAND_LOOP )
- {
- //llinfos << ">>> LLMediaEngine::process_parcel_media with command = " <<( '0' + command ) << llendl;
-
- // huh? what is play?
- //convertImageAndLoadUrl( play );
- //convertImageAndLoadUrl( true, false, std::string() );
- }
- else
// unload
if( command == PARCEL_MEDIA_COMMAND_UNLOAD )
{
@@ -354,10 +357,36 @@ void LLViewerParcelMedia::processParcelMediaUpdate( LLMessageSystem *msg, void *
(parcel->getMediaHeight() == media_height) &&
(parcel->getMediaAutoScale() == media_auto_scale) &&
(parcel->getMediaLoop() == media_loop));
+
+ if (!same)
+ {
+ // temporarily store these new values in the parcel
+ parcel->setMediaURL(media_url);
+ parcel->setMediaType(media_type.c_str());
+ parcel->setMediaID(media_id);
+ parcel->setMediaWidth(media_width);
+ parcel->setMediaHeight(media_height);
+ parcel->setMediaAutoScale(media_auto_scale);
+ parcel->setMediaLoop(media_loop);
+
+ play(parcel);
+ }
}
+}
+
+void callback_play_media(S32 option, void* data)
+{
+ LLParcel* parcel = (LLParcel*)data;
+ if (option == 0)
+ {
+ gSavedSettings.setBOOL("AudioStreamingVideo", TRUE);
+ LLViewerParcelMedia::play(parcel);
+ }
+ else
+ {
+ gSavedSettings.setBOOL("AudioStreamingVideo", FALSE);
+ }
+ gSavedSettings.setWarning("FirstStreamingVideo", FALSE);
- if (!same)
- LLViewerMedia::play(media_url, media_type, media_id,
- media_auto_scale, media_width, media_height,
- media_loop);
}
+