Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

XML playlist location that contains querystring

25 replies [Last post]

Hi All,

I've searched the forum so I hope this hasn't been asnwered elsewhere. I'm trying to use a Flickr RSS feed as my playlist for the image rotator. The problem I face is that I'm trying to display the feed for a specific 'set' of images based on a keyword. Both of which are identified on the querystring e.g.

http://api.flickr.com/services/feeds/photos_public.gne?id=8061742@N07&format=atom&tags=Nottingham

How can I use this in my embed statment without the Flickr querystring variables being treated as flashvars. I'm using the following on myspace:

<object enableJSURL="false" enableHREF="false" saveEmbedTags="true" allowScriptAccess="never" allownetworking="internal" type="application/x-shockwave-flash" allowScriptAccess="never" allownetworking="internal" height="250" width="250" border="0" data="http://www.happymondaysonline.com/mediaplayer/imagerotator.swf">
<param name="allowScriptAccess" value="never" />
<param name="allowNetworking" value="internal" />
<param name="movie" value="http://www.happymondaysonline.com/mediaplayer/imagerotator.swf" />
<param name="quality" value="high" />
<param name="flashvars" value="file=http://api.flickr.com/services/feeds/photos_public.gne?id=8061742@N07&format=atom&tags=Nottingham&lightcolor=0xFD1094&linkfromdisplay=false&transition=random&shownavigation=true&rotatetime=4&overstretch=true" />
<param name="wmode" value="transparent" />
</object>

and the following elsewhere:

<script type="text/javascript">
var FO = {movie:"imagerotator.swf",width:"400",height:"400",majorversion:"7",build:"0",bgcolor:"#000000", flashvars:"file=http://api.flickr.com/services/feeds/photos_public.gne?id=8061742@N07&format=atom&tags=Nottingham&li..." };
UFO.create(FO, "player");
</script>

...both to no avail. It displays images from the right account (the id=8061742@N07), but &format=atom&tags=Nottingham are being ignored. I've tried URLencoding the ampersands in the flickr querystring but that didn't work either.

Is there a way to do this? Any help greatly appreciated.

Sorry I forgot to use code tags there :$

@Steve Cooke,

From the readme:

"I'd like to point out two common pitfalls users encounter when using playlists. First, a playlist should always reside on the same server as the SWF file, due to security restrictions of the Flash Player (there is a small workaround, the "external_feed.php" in the "extras" folder of this download)."

Do you have a server available where you could run this proxy from? It works, I have tested it with your code. Your "file=" would be:

file=http://my.domain.com/path-to-file/SteveCooke_proxy.php

The proxy code is:

<?php

/*
You can use this script to pass-through a playlist from an external server to the players.
Just insert the url to external playlist below and copy this file to your server.
You can use the flashvar "file=external_feed.php" in your HTML feed this script to the player.
*/

// build file headers

header("content-type:text/xml;charset=utf-8");
// refer to file
readfile("http://api.flickr.com/services/feeds/photos_public.gne?id=8061742@N07&format=atom&tags=Nottingham");
// that's all
exit();

?>

Thanks Will, I don't have PHP at my disposal for this project, but I can knock together a similar ASP proxy. My brain wasn't in gear yesterday. I was so focused on encoding the ampersands somehow I just never considered alternative methods of delivering the XML to the player.

Cheers.

@Steve,

Once you have a proxy, you can do lots of manipulation of the feed to produce your playlist.

For some examples, look at what I did [url=http://www.jeroenwijering.com/?thread=5752]here[/url].

hi... help Me !!!!

used :
var s1 = new SWFObject("flvplayer.swf","playlist","425","320","7");

this
s1.addVariable(""file"",""http://domain.com/music-videos/generate-file.asp?watchVideo=30405056&type=flv"");

generate this XML

<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
<track>
<title>AD: Condoms Skin Skin - Chewing Gum</title>
<creator></creator>
<location>http://ash-v209.ash.youtube.com/get_video?video_id=t61Ef5RwkCY&type=flv</location>
</track>
<track>
<title>Snow Patrol - Open Your Eyes</title>
<creator></creator>
<location>http://sjc-v4.sjc.youtube.com/get_video?video_id=InzRp3Vbik0&type=flv</location>
</track>
</trackList>
</playlist>

not work .... but if all the content generated in generate-file.asp?watchVideo=30405056 is saved in test.xml WORK !!

s1.addVariable(""file"",""test.xml"",""0"");

how can call the playlist with asp and QueryStrings ?? it's possible ??

henry@allhen.com
anonymusanonymizer@hotmail.com

@henry,

I copied your playlist EXACTLY from your post above and it worked for me. I can't check what you are really generating here: http://domain.com/music-videos/generate-file.asp?watchVideo=30405056&type=flv because domain.com is bogus, but I assume that you copied the generated playlist exactly.

A slightly better version of your playist would look like this:

<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
<track>
<title>AD: Condoms Skin Skin - Chewing Gum</title>
<creator></creator>
<location>http://ash-v209.ash.youtube.com/get_video?video_id=t61Ef5RwkCY</location>
<meta rel="type">flv</meta>
</track>
<track>
<title>Snow Patrol - Open Your Eyes</title>
<creator></creator>
<location>http://sjc-v4.sjc.youtube.com/get_video?video_id=InzRp3Vbik0</location>
<meta rel="type">flv</meta>
</track>
</trackList>
</playlist>

Add the bold lines and delete &type=flv.

Played with this HTML:

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

  <script type="text/javascript" src="swfobject.js">
  </script>

  <title>henry flashplayer test</title>

</head>

<body>

  <div id="player">
    <a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a>
    to see this player.
  </div>

  <script type="text/javascript">
    var so = new SWFObject('flvplayer.swf', 'playlist', '320', '329', '7');
        so.addVariable('displayheight', '240');
        so.addVariable('file', 'playlist_henry.xml');
      //so.addVariable('file', 'http://domain.com/music-videos/generate-file.asp?watchVideo=30405056&type=flv');
        so.addVariable('height', '329');
        so.addVariable('width', '320');
        so.write('player');
  </script>

</body>

</html>

work : ??

so.addVariable('file', 'http://domain.com/music-videos/generate-file.asp?watchVideo=30405056');

and add <meta rel="type">flv</meta> inside of generate-file.asp ???

?

but if have more of 10 users viewing different videos ?
i think that this not work !!

so.addVariable('file', 'playlist_henry.xml');

anonymusanonymizer@hotmail.com

and if the playlist have 10 items !!

sometimes the playlist start in a item that not is item # 1 ?

how configure that start in item 1 >> item 2 >> item 3

@henry,

Please see the readme here: [url=http://www.jeroenwijering.com/extras/readme.html]JW PLAYERS 3.99 README[/url], specifically the flashvar 'shuffle' (set it to false).

I don't understand your posts about more than 10 users. Could you please explain what your concern is.

version 3.99

if write this >>

so.addVariable("file","http://www.allhen.com/music-videos/generate-file-xml.asp?watchVideo=484845474");

-- OK

but if

so.addVariable("file","http://streaming.video.allhen.com/?watchVideo=484845474");
not work ??? why .. if the playlist is the same !!

in the playlist !

if put this ;

the AD charge but the next video not work !!

<?xml version="1.0" encoding="UTF-8" ?>
- <playlist version="1" xmlns="http://xspf.org/ns/0/">
- <trackList>
- <track>
<title>Ad: Coca Cola</title>
<location>http://sjl-v22.sjl.youtube.com/get_video?video_id=GV5vcl6088w</location>
<meta rel="type">flv</meta>
<album>preroll</album>
</track>
- <track>
<creator>The Green Children</creator>
<title>Live From Norway</title>
<location>http://ash-v126.ash.youtube.com/get_video?video_id=igbJ2CIYHbU</location>
<meta rel="type">flv</meta>
<image>http://img.youtube.com/vi/igbJ2CIYHbU/1.jpg</image>
</track>
</trackList>
</playlist>

and if put this

work correctly !!!!

<?xml version="1.0" encoding="UTF-8" ?>
- <playlist version="1" xmlns="http://xspf.org/ns/0/">
- <trackList>
- <track>
<title>Spot a Job</title>
<location>http://www.jeroenwijering.com/extras/spotajob.flv</location>
<meta rel="type">flv</meta>
<album>preroll</album>
</track>
- <track>
<creator>The Green Children</creator>
<title>Live From Norway</title>
<location>http://ash-v126.ash.youtube.com/get_video?video_id=igbJ2CIYHbU</location>
<meta rel="type">flv</meta>
<image>http://img.youtube.com/vi/igbJ2CIYHbU/1.jpg</image>
</track>
</trackList>
</playlist>

@henry,

Please download this image to see why your playlist fails.

[url=http://willswonders.myip.org:8085/downloads/henry_image_1.jpg]henry_image_1.jpg[/url]

Apparently you are outputting a "tab" character before the "<?xml...".

You need to validate your playlists by loading them in a browser such as Opera that is very "picky". If the playlists are not valid XML, they will not work in the FLV player.

This playlist file works fine, copied and pasted exactly from your post:

<?xml version="1.0" encoding="UTF-8" ?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
  <trackList>
    <track>
      <title>Ad: Coca Cola</title>
      <location>http://sjl-v22.sjl.youtube.com/get_video?video_id=GV5vcl6088w</location>
      <meta rel="type">flv</meta>
      <album>preroll</album>
    </track>
    <track>
      <creator>The Green Children</creator>
      <title>Live From Norway</title>
      <location>http://ash-v126.ash.youtube.com/get_video?video_id=igbJ2CIYHbU</location>
      <meta rel="type">flv</meta>
      <image>http://img.youtube.com/vi/igbJ2CIYHbU/1.jpg</image>
    </track>
  </trackList>
</playlist>

This page is not Valid XML!
Below are the results of checking this document for XML well-formedness and validity.

Error Line 2 column 0: no document type declaration; will parse without validation.
<playlist version="1" xmlns="http://xspf.org/ns/0/">

This playlist: http://streaming.video.allhen.com/?watchVideo=484845474 does not work because your player is coming from another domain. Change the URL to the player to be:
http://streaming.video.allhen.com/flvplayer.swf and put a "flvplayer.swf" file there and it will work.

Details here:
[url=http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14213&sliceId=1]External data not accessible outside a Macromedia Flash movie's domain[/url]

hello again !!

this playlist the first item is showed !!

but the next item not load !!

why ??

<?xml version="1.0" encoding="utf-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
<track>
<title>Coca - Cola</title>
<location>http://sjl-v22.sjl.youtube.com/get_video?video_id=GV5vcl6088w</location>
<meta rel="type">flv</meta>
<album>preroll</album>
</track>
<track>
<creator>Gnarls Barkley</creator>
<title>Crazy (Live Letterman's Late Show )</title>
<location>http://sjc-v96.sjc.youtube.com/get_video?video_id=vbfhXyfbIfo</location>
<meta rel="type">flv</meta>
<image>http://img.youtube.com/vi/vbfhXyfbIfo/1.jpg</image>
</track>
</trackList>
</playlist>

Plays fine for me.

If you are expecting the playing to be automatic after the preroll finishes, you may need to add this to your player code:

so.addVariable('repeat', 'list');

Or maybe the first file isn't properly encoded to access the end of the file and you need to find a different test file.

If that doesn't work, please post your entire HTML page code or a link so we can take a look.

so.addVariable('repeat', 'list');
it's add !!

i think that " the first file isn't properly encoded to access the end of the file " but with other file (Spotajob.flv) work correctly

<script type="text/javascript">
var so = new SWFObject('http://streaming.video.allhen.com/music-videos/flvplayer.swf', 'playlist', '425', '380', '7');
so.addParam("allowfullscreen","true");
so.addVariable("displayheight","320");
so.addVariable("file","http://streaming.video.allhen.com/music-videos/000.xml");
so.addVariable("autostart","true");
so.addVariable("bufferlength","5");
so.addVariable("repeat","list");
so.addVariable("volume","100");
so.addVariable("frontcolor","0xFFFFFF");
so.addVariable("backcolor","0xA2D030");
so.addVariable("lightcolor","0xFF930D");
so.addVariable("thumbsinplaylist","true");
so.addVariable("showdownload","false");
so.write('player');
</script>

<location>http://sjl-v22.sjl.youtube.com/get_video?video_id=GV5vcl6088w.flv</location>
[s]<meta rel="type">flv</meta>[/s]

works for me...

use the wizard !!

put this

http://allhen.com/music-videos/000.xml (preroll)
http://allhen.com/music-videos/0000.xml (playlist with 2 items)

and in the 2 files only charge the first item !!

repeat is selected "list" !!

see in your wizard page !!

if player (3.99) http://allhen.com/music-videos/flvplayer.swf

and file = http://allhen.com/music-videos/000.xml (with preroll) and
<meta rel="type">flv</meta>
1 item work and the 2 item not charge.

but if <meta rel="type">flv</meta> is deleted the 1 item not charge and 2 item work correctly !!

and

if player (3.7) http://allhen.com/music-videos/flvplayer3.7.swf

and file = http://allhen.com/music-videos/000.xml (with preroll) and
<meta rel="type">flv</meta>
items 1 and 2 work correctly . but (thumbs in playlist = active) show item 1 (in version 3.99 when preroll is selected not show the info of the item )

The querystring parameters in a "file" variable value are stripped out. This isn't good when my dynamic playlist page requires querystring values in order to render correctly? Any ideas?

fileURL = "http://mydomain.com/asxplaylist.aspx?mediaids=469042;468988&mediaplayer=flv&foo=bar";

$.addVariable("file", fileURL);

results in a get request from the JW Player to the following URL.

http://mydomain.com/asxplaylist.aspx?mediaids=469042;468988&208"

It replaces everything past the ambersand with a number.

Well, I spoke too soon, obviously I should have been URL encoding this URL.

Like so:

fileURL = encodeURIComponent("http://mydomain.com/asxplaylist.aspx?mediaids=469042;468988&mediaplayer=flv&foo=bar");