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.cpp61
1 files changed, 30 insertions, 31 deletions
diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp
index c4fc2e5cab..202f8822e3 100644
--- a/indra/newview/llviewerparcelmedia.cpp
+++ b/indra/newview/llviewerparcelmedia.cpp
@@ -35,6 +35,7 @@
#include "llagent.h"
#include "llaudioengine.h"
+#include "llmimetypes.h"
#include "llviewercontrol.h"
#include "llviewermedia.h"
#include "llviewerregion.h"
@@ -105,15 +106,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() ||
- !parcel->getMusicURL().empty())
- && LLViewerMedia::needsMediaFirstRun())
- {
- LLViewerMedia::displayMediaFirstRun();
- return;
- }
-
// if we have a current (link sharing) url, use it instead
if (mediaCurrentUrl != "" && parcel->getMediaType() == "text/html")
{
@@ -219,25 +211,29 @@ void LLViewerParcelMedia::play(LLParcel* parcel)
// A new impl will be created below.
}
}
-
- if(!sMediaImpl)
+
+ // Don't ever try to play if the media type is set to "none/none"
+ if(stricmp(mime_type.c_str(), LLMIMETypes::getDefaultMimeType().c_str()) != 0)
{
- LL_DEBUGS("Media") << "new media impl with mime type " << mime_type << ", url " << media_url << LL_ENDL;
-
- // There is no media impl, make a new one
- 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);
- }
+ if(!sMediaImpl)
+ {
+ LL_DEBUGS("Media") << "new media impl with mime type " << mime_type << ", url " << media_url << LL_ENDL;
+
+ // There is no media impl, make a new one
+ 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);
+ }
- //LLFirstUse::useMedia();
+ //LLFirstUse::useMedia();
- LLViewerParcelMediaAutoPlay::playStarted();
+ LLViewerParcelMediaAutoPlay::playStarted();
+ }
}
// static
@@ -311,7 +307,7 @@ LLPluginClassMediaOwner::EMediaStatus LLViewerParcelMedia::getStatus()
// static
std::string LLViewerParcelMedia::getMimeType()
{
- return sMediaImpl.notNull() ? sMediaImpl->getMimeType() : "none/none";
+ return sMediaImpl.notNull() ? sMediaImpl->getMimeType() : LLMIMETypes::getDefaultMimeType();
}
//static
@@ -321,11 +317,14 @@ std::string LLViewerParcelMedia::getURL()
if(sMediaImpl.notNull())
url = sMediaImpl->getMediaURL();
- if (url.empty())
- url = LLViewerParcelMgr::getInstance()->getAgentParcel()->getMediaCurrentURL();
-
- if (url.empty())
- url = LLViewerParcelMgr::getInstance()->getAgentParcel()->getMediaURL();
+ if(stricmp(LLViewerParcelMgr::getInstance()->getAgentParcel()->getMediaType().c_str(), LLMIMETypes::getDefaultMimeType().c_str()) != 0)
+ {
+ if (url.empty())
+ url = LLViewerParcelMgr::getInstance()->getAgentParcel()->getMediaCurrentURL();
+
+ if (url.empty())
+ url = LLViewerParcelMgr::getInstance()->getAgentParcel()->getMediaURL();
+ }
return url;
}