void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type,  bool rediscover_type)
{
	LLPluginClassMedia* plugin = getMediaPlugin();
	if(rediscover_type)
	{

		LLURI uri(url);
		std::string scheme = uri.scheme();

		if(scheme.empty() || ("http" == scheme || "https" == scheme))
		{
			if(mime_type.empty())
			{
				LLHTTPClient::getHeaderOnly( url, new LLMimeDiscoveryResponder(this));
			}
			else if(initializeMedia(mime_type) && (plugin = getMediaPlugin()))
			{
				plugin->loadURI( url );
			}
		}
		else if("data" == scheme || "file" == scheme || "about" == scheme)
		{
			// FIXME: figure out how to really discover the type for these schemes
			// We use "data" internally for a text/html url for loading the login screen
			if(initializeMedia("text/html") && (plugin = getMediaPlugin()))
			{
				plugin->loadURI( url );
			}
		}
		else
		{
			// This catches 'rtsp://' urls
			if(initializeMedia(scheme) && (plugin = getMediaPlugin()))
			{
				plugin->loadURI( url );
			}
		}
	}
	else if (plugin)
	{
		plugin->loadURI( url );
	}
	else if(initializeMedia(mime_type) && (plugin = getMediaPlugin()))
	{
		plugin->loadURI( url );
	}
	else
	{
		LL_WARNS("Media") << "Couldn't navigate to: " << url << " as there is no media type for: " << mime_type << LL_ENDL;
		return;
	}
	mMediaURL = url;

}
void LLViewerMediaImpl::play()
{
	LLPluginClassMedia* plugin = getMediaPlugin();

	// first stop any previously playing media
	// stop();

	// plugin->addObserver( this );
	if (!plugin)
	{
	 	if(!initializePlugin(mMimeType))
		{
			// Plugin failed initialization... should assert or something
			return;
		}
		plugin = getMediaPlugin();
	}
	
	// updateMovieImage(mTextureId, true);

	plugin->loadURI( mMediaURL );
	if(/*plugin->pluginSupportsMediaTime()*/ true)
	{
		start();
	}
}
void LLViewerMediaImpl::navigateHome()
{
	LLPluginClassMedia* plugin = getMediaPlugin();
	if (plugin)
	{
		plugin->loadURI( mHomeURL );
	}
}