summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2008-07-22 14:51:56 +0200
committerBenjamin Otte <otte@gnome.org>2008-07-22 14:56:35 +0200
commit7626dc407ba0c913fcd679adea6ff3937d43bdaa (patch)
tree0d447cc9ca7001deb93c09bd69885f7b2c3ce417
parent2145273ffe79a86b0230c3585e86fee4f831c892 (diff)
append the flashvars to the initial file's url
-rw-r--r--src/swfmoz_loader.c1
-rw-r--r--src/swfmoz_loader.h1
-rw-r--r--src/swfmoz_player.c17
3 files changed, 16 insertions, 3 deletions
diff --git a/src/swfmoz_loader.c b/src/swfmoz_loader.c
index afe33af..01c0757 100644
--- a/src/swfmoz_loader.c
+++ b/src/swfmoz_loader.c
@@ -60,6 +60,7 @@ swfmoz_loader_load (SwfdecLoader *loader, SwfdecPlayer *player,
if (mozplay->initial) {
swfmoz_loader_set_stream (moz, mozplay->initial);
mozplay->initial = NULL;
+ moz->initial = TRUE;
} else {
g_object_ref (moz);
if (buffer) {
diff --git a/src/swfmoz_loader.h b/src/swfmoz_loader.h
index 889e542..d1c4e25 100644
--- a/src/swfmoz_loader.h
+++ b/src/swfmoz_loader.h
@@ -42,6 +42,7 @@ struct _SwfmozLoader
NPP instance; /* instance we belong to */
NPStream * stream; /* stream we do or NULL if not created yet */
+ gboolean initial; /* we are the initial loader */
gboolean waiting_for_stream;
char * cache_file; /* where the file is cached */
diff --git a/src/swfmoz_player.c b/src/swfmoz_player.c
index ea49286..970228a 100644
--- a/src/swfmoz_player.c
+++ b/src/swfmoz_player.c
@@ -522,9 +522,10 @@ swfmoz_player_loaders_update (GtkListStore *store, GtkTreeIter *iter, SwfdecLoad
goffset loaded, size;
gboolean error;
const SwfdecURL *url;
+ SwfdecPlayer *player;
const char *url_string;
char *str_loaded, *str_size;
- gchar *status;
+ gchar *status, *s = NULL;
loaded = swfdec_loader_get_loaded (loader);
size = swfdec_loader_get_size (loader);
@@ -551,7 +552,16 @@ swfmoz_player_loaders_update (GtkListStore *store, GtkTreeIter *iter, SwfdecLoad
}
url = swfdec_loader_get_url (loader);
- if (url) {
+ player = SWFMOZ_LOADER (loader)->instance->pdata;
+ if (url && SWFMOZ_LOADER (loader)->initial && swfdec_player_get_variables (player)) {
+ /* This auto-appends the FlashVars to the reported URL. You should be able
+ * to copy/paste that URL easily without breakage that way
+ * (minus cookies and referer) */
+ s = g_strconcat (swfdec_url_get_url (url),
+ swfdec_url_get_query (url) ? "&" : "?",
+ swfdec_player_get_variables (player), NULL);
+ url_string = s;
+ } else if (url) {
url_string = swfdec_url_get_url (url);
} else if (SWFMOZ_LOADER (loader)->stream) {
url_string = SWFMOZ_LOADER (loader)->stream->url;
@@ -567,7 +577,8 @@ swfmoz_player_loaders_update (GtkListStore *store, GtkTreeIter *iter, SwfdecLoad
SWFMOZ_LOADER_COLUMN_STATUS, status,
-1);
- g_free(status);
+ g_free (status);
+ g_free (s);
}
static gboolean