diff options
-rw-r--r-- | indra/newview/llpanelprimmediacontrols.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 4 |
3 files changed, 24 insertions, 15 deletions
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index cbff13a20f..fb0b5dff1f 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -291,7 +291,7 @@ void LLPanelPrimMediaControls::updateShape() // Disable zoom if HUD zoom_ctrl->setEnabled(!objectp->isHUDAttachment()); secure_lock_icon->setVisible(false); - mCurrentURL = media_impl->getMediaURL(); + mCurrentURL = media_impl->getCurrentMediaURL(); back_ctrl->setEnabled((media_impl != NULL) && media_impl->canNavigateBack() && can_navigate); fwd_ctrl->setEnabled((media_impl != NULL) && media_impl->canNavigateForward() && can_navigate); @@ -758,20 +758,10 @@ void LLPanelPrimMediaControls::onClickHome() void LLPanelPrimMediaControls::onClickOpen() { - LLViewerMediaImpl* impl =getTargetMediaImpl(); + LLViewerMediaImpl* impl = getTargetMediaImpl(); if(impl) { - if(impl->getMediaPlugin()) - { - if(impl->getMediaPlugin()->getLocation().empty()) - { - LLWeb::loadURL(impl->getMediaURL()); - } - else - { - LLWeb::loadURL( impl->getMediaPlugin()->getLocation()); - } - } + LLWeb::loadURL(impl->getCurrentMediaURL()); } } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 8bd74dcb04..20e9208a4e 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1023,6 +1023,16 @@ bool LLViewerMediaImpl::hasFocus() const return mHasFocus; } +std::string LLViewerMediaImpl::getCurrentMediaURL() +{ + if(!mCurrentMediaURL.empty()) + { + return mCurrentMediaURL; + } + + return mMediaURL; +} + ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::mouseDown(S32 x, S32 y, MASK mask, S32 button) { @@ -1181,7 +1191,7 @@ void LLViewerMediaImpl::navigateForward() ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::navigateReload() { - navigateTo(mMediaURL, "", true, false); + navigateTo(getCurrentMediaURL(), "", true, false); } ////////////////////////////////////////////////////////////////////////////////////////// @@ -1203,6 +1213,9 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi mMediaURL = url; mMimeType = mime_type; + // Clear the current media URL, since it will no longer be correct. + mCurrentMediaURL.clear(); + // if mime type discovery was requested, we'll need to do it when the media loads mNavigateRediscoverType = rediscover_type; @@ -1702,10 +1715,12 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla if(getNavState() == MEDIANAVSTATE_BEGUN) { + mCurrentMediaURL = plugin->getNavigateURI(); setNavState(MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED); } else if(getNavState() == MEDIANAVSTATE_SERVER_BEGUN) { + mCurrentMediaURL = plugin->getNavigateURI(); setNavState(MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED); } else @@ -1721,10 +1736,12 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla if(getNavState() == MEDIANAVSTATE_BEGUN) { + mCurrentMediaURL = plugin->getLocation(); setNavState(MEDIANAVSTATE_FIRST_LOCATION_CHANGED); } else if(getNavState() == MEDIANAVSTATE_SERVER_BEGUN) { + mCurrentMediaURL = plugin->getLocation(); setNavState(MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED); } else diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 4f0d39dd80..76606be685 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -159,6 +159,7 @@ public: bool canNavigateForward(); bool canNavigateBack(); std::string getMediaURL() { return mMediaURL; } + std::string getCurrentMediaURL(); std::string getHomeURL() { return mHomeURL; } void setHomeURL(const std::string& home_url) { mHomeURL = home_url; }; std::string getMimeType() { return mMimeType; } @@ -272,9 +273,10 @@ public: LLPluginClassMedia* mMediaSource; LLUUID mTextureId; bool mMovieImageHasMips; - std::string mMediaURL; + std::string mMediaURL; // The last media url set with NavigateTo std::string mHomeURL; std::string mMimeType; + std::string mCurrentMediaURL; // The most current media url from the plugin (via the "location changed" or "navigate complete" events). S32 mLastMouseX; // save the last mouse coord we get, so when we lose capture we can simulate a mouseup at that point. S32 mLastMouseY; S32 mMediaWidth; |