From bceafa5062db394048312aa7fe0a7706fb9524b7 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Tue, 10 May 2016 17:16:24 -0700 Subject: working test button in web browser floater - video inverted --- indra/media_plugins/libvlc/media_plugin_libvlc.cpp | 2 +- indra/newview/llfloaterwebcontent.cpp | 26 +++++-- indra/newview/llfloaterwebcontent.h | 1 + indra/newview/llmimetypes.cpp | 3 +- .../skins/default/xui/en/floater_web_content.xml | 88 +++++++++++++++++++++- indra/newview/skins/default/xui/en/mime_types.xml | 25 ++++-- 6 files changed, 125 insertions(+), 20 deletions(-) diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index ceb42c0f13..08716e1a1c 100644 --- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp +++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp @@ -289,7 +289,7 @@ void MediaPluginLibVLC::receiveMessage( const char* message_string ) message.setValueU32("internalformat", GL_RGB); message.setValueU32("format", GL_BGRA_EXT); message.setValueU32("type", GL_UNSIGNED_BYTE); - message.setValueBoolean("coords_opengl", false); + message.setValueBoolean("coords_opengl", true); sendMessage(message); } else if(message_name == "size_change") diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 024e315632..c039b3b8f4 100755 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -81,7 +81,8 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params ) mCommitCallbackRegistrar.add( "WebContent.Reload", boost::bind( &LLFloaterWebContent::onClickReload, this )); mCommitCallbackRegistrar.add( "WebContent.Stop", boost::bind( &LLFloaterWebContent::onClickStop, this )); mCommitCallbackRegistrar.add( "WebContent.EnterAddress", boost::bind( &LLFloaterWebContent::onEnterAddress, this )); - mCommitCallbackRegistrar.add( "WebContent.PopExternal", boost::bind( &LLFloaterWebContent::onPopExternal, this )); + mCommitCallbackRegistrar.add( "WebContent.PopExternal", boost::bind(&LLFloaterWebContent::onPopExternal, this)); + mCommitCallbackRegistrar.add( "WebContent.TestVideo", boost::bind(&LLFloaterWebContent::onTestVideo, this, _2)); } BOOL LLFloaterWebContent::postBuild() @@ -229,7 +230,7 @@ void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p) for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++) { LL_DEBUGS() << " " << (*iter)->getKey()["target"] << LL_ENDL; - } + } if(instances.size() >= (size_t)browser_window_limit) { @@ -243,9 +244,9 @@ void LLFloaterWebContent::open_media(const Params& p) { // Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin. LLViewerMedia::proxyWindowOpened(p.target(), p.id()); - mWebBrowser->setHomePageUrl(p.url, HTTP_CONTENT_TEXT_HTML); + mWebBrowser->setHomePageUrl(p.url); mWebBrowser->setTarget(p.target); - mWebBrowser->navigateTo(p.url, HTTP_CONTENT_TEXT_HTML, p.clean_browser); + mWebBrowser->navigateTo(p.url); set_current_url(p.url); @@ -499,7 +500,7 @@ void LLFloaterWebContent::onEnterAddress() LLStringUtil::trim(url); if ( url.length() > 0 ) { - mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML); + mWebBrowser->navigateTo(url); }; } @@ -508,9 +509,18 @@ void LLFloaterWebContent::onPopExternal() // make sure there is at least something there. // (perhaps this test should be for minimum length of a URL) std::string url = mAddressCombo->getValue().asString(); - LLStringUtil::trim(url); - if ( url.length() > 0 ) + LLStringUtil::trim(url); + if (url.length() > 0) + { + LLWeb::loadURLExternal(url); + }; +} + +void LLFloaterWebContent::onTestVideo(std::string url) +{ + LLStringUtil::trim(url); + if (url.length() > 0) { - LLWeb::loadURLExternal( url ); + mWebBrowser->navigateTo(url); }; } diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 4291fd9f2c..519b575b38 100755 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -92,6 +92,7 @@ protected: void onClickStop(); void onEnterAddress(); void onPopExternal(); + void onTestVideo(std::string url); static void preCreate(Params& p); void open_media(const Params& ); diff --git a/indra/newview/llmimetypes.cpp b/indra/newview/llmimetypes.cpp index a2df14b4e7..790a184068 100755 --- a/indra/newview/llmimetypes.cpp +++ b/indra/newview/llmimetypes.cpp @@ -184,8 +184,7 @@ std::string LLMIMETypes::implType(const std::string& mime_type) mime_info_map_t::const_iterator it = sMap.find(mime_type); if (it != sMap.end()) { - return "media_plugin_libvlc"; - //return it->second.mImpl; + return it->second.mImpl; } else { diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index a80440e844..86be363245 100755 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -25,10 +25,10 @@ @@ -152,6 +152,90 @@ + + + + + + + + + - media_plugin_cef + media_plugin_libvlc @@ -207,7 +207,7 @@ movie - media_plugin_cef + media_plugin_libvlc @@ -449,7 +449,7 @@ movie - media_plugin_cef + media_plugin_libvlc @@ -460,10 +460,21 @@ movie - media_plugin_cef + media_plugin_libvlc - + + + + movie + + + media_plugin_libvlc + + + @@ -471,7 +482,7 @@ movie - media_plugin_cef + media_plugin_libvlc @@ -482,7 +493,7 @@ movie - media_plugin_cef + media_plugin_libvlc -- cgit v1.2.3