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.cpp55
1 files changed, 9 insertions, 46 deletions
diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp
index 90a7ee98b9..2c5c0a37e8 100644
--- a/indra/newview/llviewerparcelmedia.cpp
+++ b/indra/newview/llviewerparcelmedia.cpp
@@ -34,6 +34,7 @@
#include "llviewerparcelmedia.h"
#include "llagent.h"
+#include "llaudioengine.h"
#include "llviewercontrol.h"
#include "llviewermedia.h"
#include "llviewerregion.h"
@@ -44,7 +45,7 @@
#include "llviewermediafocus.h"
#include "llviewerparcelmediaautoplay.h"
#include "llnotificationsutil.h"
-#include "llfirstuse.h"
+//#include "llfirstuse.h"
#include "llpluginclassmedia.h"
#include "llviewertexture.h"
@@ -55,10 +56,6 @@ LLUUID LLViewerParcelMedia::sMediaRegionID;
viewer_media_t LLViewerParcelMedia::sMediaImpl;
-// Local functions
-bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel);
-
-
// static
void LLViewerParcelMedia::initClass()
{
@@ -108,15 +105,6 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
std::string mediaUrl = std::string ( parcel->getMediaURL () );
std::string mediaCurrentUrl = std::string( parcel->getMediaCurrentURL());
- // First use warning
- if( ! mediaUrl.empty() && gWarningSettings.getBOOL("FirstStreamingVideo") )
- {
- LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(),
- boost::bind(callback_play_media, _1, _2, parcel));
- return;
-
- }
-
// if we have a current (link sharing) url, use it instead
if (mediaCurrentUrl != "" && parcel->getMediaType() == "text/html")
{
@@ -182,7 +170,7 @@ void LLViewerParcelMedia::play(LLParcel* parcel)
if (!parcel) return;
- if (!gSavedSettings.getBOOL("AudioSteamingMedia") || !gSavedSettings.getBOOL("AudioStreamingVideo"))
+ if (!gSavedSettings.getBOOL("AudioStreamingMedia"))
return;
std::string media_url = parcel->getMediaURL();
@@ -215,22 +203,15 @@ void LLViewerParcelMedia::play(LLParcel* parcel)
else
{
// Since the texture id is different, we need to generate a new impl
- LL_DEBUGS("Media") << "new media impl with mime type " << mime_type << ", url " << media_url << LL_ENDL;
// Delete the old one first so they don't fight over the texture.
sMediaImpl = NULL;
-
- sMediaImpl = LLViewerMedia::newMediaImpl(
- placeholder_texture_id,
- media_width,
- media_height,
- media_auto_scale,
- media_loop);
- sMediaImpl->setIsParcelMedia(true);
- sMediaImpl->navigateTo(media_url, mime_type, true);
+
+ // A new impl will be created below.
}
}
- else
+
+ if(!sMediaImpl)
{
LL_DEBUGS("Media") << "new media impl with mime type " << mime_type << ", url " << media_url << LL_ENDL;
@@ -245,7 +226,7 @@ void LLViewerParcelMedia::play(LLParcel* parcel)
sMediaImpl->navigateTo(media_url, mime_type, true);
}
- LLFirstUse::useMedia();
+ //LLFirstUse::useMedia();
LLViewerParcelMediaAutoPlay::playStarted();
}
@@ -284,7 +265,7 @@ void LLViewerParcelMedia::start()
}
sMediaImpl->start();
- LLFirstUse::useMedia();
+ //LLFirstUse::useMedia();
LLViewerParcelMediaAutoPlay::playStarted();
}
@@ -588,24 +569,6 @@ void LLViewerParcelMedia::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
};
}
-bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel)
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
- if (option == 0)
- {
- gSavedSettings.setBOOL("AudioStreamingVideo", TRUE);
- if(!gSavedSettings.getBOOL("AudioSteamingMedia"))
- gSavedSettings.setBOOL("AudioSteamingMedia", TRUE);
- LLViewerParcelMedia::play(parcel);
- }
- else
- {
- gSavedSettings.setBOOL("AudioStreamingVideo", FALSE);
- }
- gWarningSettings.setBOOL("FirstStreamingVideo", FALSE);
- return false;
-}
-
// TODO: observer
/*
void LLViewerParcelMediaNavigationObserver::onNavigateComplete( const EventType& event_in )