working test button in web browser floater - video inverted

meow-7.2.2
callum_linden 2016-05-10 17:16:24 -07:00
parent ed73eae302
commit bceafa5062
6 changed files with 125 additions and 20 deletions

View File

@ -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")

View File

@ -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 );
LLWeb::loadURLExternal(url);
};
}
void LLFloaterWebContent::onTestVideo(std::string url)
{
LLStringUtil::trim(url);
if (url.length() > 0)
{
mWebBrowser->navigateTo(url);
};
}

View File

@ -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& );

View File

@ -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
{

View File

@ -25,10 +25,10 @@
<layout_panel
auto_resize="false"
default_tab_group="1"
height="22"
height="44"
layout="topleft"
left="0"
min_height="20"
min_height="40"
name="nav_controls"
top="400"
width="770">
@ -152,6 +152,90 @@
<button.commit_callback
function="WebContent.PopExternal" />
</button>
<button
image_overlay="Video_URL_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="MPEG4 Video Test"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="1"
name="VLC Plugin Test"
top="22"
width="22">
<button.commit_callback
function="WebContent.TestVideo"
parameter="https://callum-linden.s3.amazonaws.com/sample_media/ss.mp4"/>
</button>
<button
image_overlay="Video_URL_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="MKV Video Test"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="27"
name="VLC Plugin Test"
top="22"
width="22">
<button.commit_callback
function="WebContent.TestVideo"
parameter="https://callum-linden.s3.amazonaws.com/sample_media/jellyfish.mkv"/>
</button>
<button
image_overlay="Video_URL_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="WebM Video Test"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="51"
name="VLC Plugin Test"
top="22"
width="22">
<button.commit_callback
function="WebContent.TestVideo"
parameter="https://callum-linden.s3.amazonaws.com/sample_media/kubo.webm"/>
</button>
<button
image_overlay="Video_URL_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="MP3 audio Test"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="75"
name="VLC Plugin Test"
top="22"
width="22">
function="WebContent.TestVideo"
parameter="https://callum-linden.s3.amazonaws.com/alegria.mp3"/>
</button>
</layout_panel>
<layout_panel
height="40"

View File

@ -185,7 +185,7 @@
movie
</widgettype>
<impl>
media_plugin_cef
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="image/*">
@ -207,7 +207,7 @@
movie
</widgettype>
<impl>
media_plugin_cef
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="application/javascript">
@ -449,7 +449,7 @@
movie
</widgettype>
<impl>
media_plugin_cef
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="video/mp4">
@ -460,10 +460,21 @@
movie
</widgettype>
<impl>
media_plugin_cef
media_plugin_libvlc
</impl>
</mimetype>
<mimetype menu="1" name="video/quicktime">
<mimetype name="application/octet-stream">
<label name="video/octet-stream">
Movie
</label>
<widgettype>
movie
</widgettype>
<impl>
media_plugin_libvlc
</impl>
</mimetype>
<mimetype menu="1" name="video/quicktime">
<label name="video/quicktime_label">
Movie (QuickTime)
</label>
@ -471,7 +482,7 @@
movie
</widgettype>
<impl>
media_plugin_cef
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="video/x-ms-asf">
@ -482,7 +493,7 @@
movie
</widgettype>
<impl>
media_plugin_cef
media_plugin_libvlc
</impl>
</mimetype>
<mimetype name="video/x-ms-wmv">