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.cpp38
1 files changed, 10 insertions, 28 deletions
diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp
index 0cdd447fcd..83b05e6b4d 100644
--- a/indra/newview/llviewerparcelmedia.cpp
+++ b/indra/newview/llviewerparcelmedia.cpp
@@ -52,6 +52,10 @@ mMediaParcelLocalID(0)
LLMessageSystem* msg = gMessageSystem;
msg->setHandlerFunc("ParcelMediaCommandMessage", parcelMediaCommandMessageHandler );
msg->setHandlerFunc("ParcelMediaUpdate", parcelMediaUpdateHandler );
+
+ // LLViewerParcelMediaAutoPlay will regularly check and autoplay media,
+ // might be good idea to just integrate it into LLViewerParcelMedia
+ LLSingleton<LLViewerParcelMediaAutoPlay>::getInstance();
}
LLViewerParcelMedia::~LLViewerParcelMedia()
@@ -80,11 +84,13 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
S32 parcelid = parcel->getLocalID();
LLUUID regionid = gAgent.getRegion()->getRegionID();
+ bool location_changed = false;
if (parcelid != mMediaParcelLocalID || regionid != mMediaRegionID)
{
LL_DEBUGS("Media") << "New parcel, parcel id = " << parcelid << ", region id = " << regionid << LL_ENDL;
mMediaParcelLocalID = parcelid;
mMediaRegionID = regionid;
+ location_changed = true;
}
std::string mediaUrl = std::string ( parcel->getMediaURL () );
@@ -102,7 +108,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
if(mMediaImpl.isNull())
{
- play(parcel);
+ // media will be autoplayed by LLViewerParcelMediaAutoPlay
return;
}
@@ -111,8 +117,9 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
|| ( mMediaImpl->getMediaTextureID() != parcel->getMediaID() )
|| ( mMediaImpl->getMimeType() != parcel->getMediaType() ))
{
- // Only play if the media types are the same.
- if(mMediaImpl->getMimeType() == parcel->getMediaType())
+ // Only play if the media types are the same and parcel stays same.
+ if(mMediaImpl->getMimeType() == parcel->getMediaType()
+ && !location_changed)
{
play(parcel);
}
@@ -128,25 +135,6 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
stop();
}
}
- /*
- else
- {
- // no audio player, do a first use dialog if there is media here
- if (parcel)
- {
- std::string mediaUrl = std::string ( parcel->getMediaURL () );
- if (!mediaUrl.empty ())
- {
- if (gWarningSettings.getBOOL("QuickTimeInstalled"))
- {
- gWarningSettings.setBOOL("QuickTimeInstalled", FALSE);
-
- LLNotificationsUtil::add("NoQuickTime" );
- };
- }
- }
- }
- */
}
// static
@@ -159,12 +147,6 @@ void LLViewerParcelMedia::play(LLParcel* parcel)
if (!gSavedSettings.getBOOL("AudioStreamingMedia"))
return;
- // This test appears all over the code and really should be facotred out into a single
- // call that returns true/false (with option ask dialog) but that is outside of scope
- // for this work so we'll just directly.
- if (gSavedSettings.getS32("ParcelMediaAutoPlayEnable") == 0 )
- return;
-
std::string media_url = parcel->getMediaURL();
std::string media_current_url = parcel->getMediaCurrentURL();
std::string mime_type = parcel->getMediaType();