summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2009-09-02 13:17:07 +0100
committerBastien Nocera <hadess@hadess.net>2009-09-02 13:18:10 +0100
commitc3a784b72a70b9fae5ef9279faa15ea4dc49933c (patch)
treecaaf9a74a7fa19e2beafca4e6f1b6282323ee771
parentd3180aafb8597a6244a9e98425c721b1a6b0a33c (diff)
downloadtotem-c3a784b72a70b9fae5ef9279faa15ea4dc49933c.tar.gz
BugĀ 375867 - check user-agents
Override the HTTP user-agents for Quicktime and Windows Media Player, fixes playback of the Apple trailers.
-rw-r--r--browser-plugin/totem-plugin-viewer.c4
-rw-r--r--browser-plugin/totemPlugin.cpp21
2 files changed, 18 insertions, 7 deletions
diff --git a/browser-plugin/totem-plugin-viewer.c b/browser-plugin/totem-plugin-viewer.c
index fd6f72215..6a87635cf 100644
--- a/browser-plugin/totem-plugin-viewer.c
+++ b/browser-plugin/totem-plugin-viewer.c
@@ -2216,10 +2216,8 @@ int main (int argc, char **argv)
/* FIXME: check the UA strings of the legacy plugins themselves */
/* FIXME: at least hxplayer seems to send different UAs depending on the protocol!? */
- /* FIXME: this won't work with gvfs:
- * http://bugzilla.gnome.org/show_bug.cgi?id=534482 */
if (arg_user_agent != NULL) {
- g_setenv ("GNOME_VFS_HTTP_USER_AGENT", arg_user_agent, TRUE);
+ g_setenv ("BACON_VIDEO_WIDGET_HTTP_USER_AGENT", arg_user_agent, TRUE);
g_free (arg_user_agent);
arg_user_agent = NULL;
}
diff --git a/browser-plugin/totemPlugin.cpp b/browser-plugin/totemPlugin.cpp
index 6038f9851..7745e7531 100644
--- a/browser-plugin/totemPlugin.cpp
+++ b/browser-plugin/totemPlugin.cpp
@@ -158,6 +158,15 @@ static const char kPluginLongDescription[] =
"The <a href=\"http://www.gnome.org/projects/totem/\">Totem</a> " PACKAGE_VERSION " plugin handles video and audio streams.";
#endif
+static const char kPluginUserAgent[] =
+#if defined(TOTEM_NARROWSPACE_PLUGIN)
+ "Quicktime/"TOTEM_NARROWSPACE_VERSION;
+#elif defined(TOTEM_GMP_PLUGIN)
+ "Windows-Media-Player/10.00.00.4019";
+#else
+ "";
+#endif
+
#if defined(TOTEM_COMPLEX_PLUGIN) && defined(HAVE_NSTARRAY_H)
nsTArray<totemPlugin*> *totemPlugin::sPlugins;
@@ -465,10 +474,14 @@ totemPlugin::ViewerFork ()
return NPERR_NO_ERROR;
#endif /* TOTEM_COMPLEX_PLUGIN */
- const char *userAgent = NPN_UserAgent (mNPP);
- if (!userAgent) {
- /* See https://bugzilla.mozilla.org/show_bug.cgi?id=328778 */
- Dm ("User agent has more than 127 characters; fix your browser!");
+ const char *userAgent = kPluginUserAgent;
+
+ if (*kPluginUserAgent == '\0') {
+ userAgent = NPN_UserAgent (mNPP);
+ if (!userAgent) {
+ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=328778 */
+ Dm ("User agent has more than 127 characters; fix your browser!");
+ }
}
GPtrArray *arr = g_ptr_array_new ();