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

Forums

/

Need help with javascript playlist for JW FLV play

21 replies [Last post]

First, let me apologize, I am very new at this. I have been able to use the JW FLV player successfully on my site. I don't really know anything about xml, so I wanted to use the javascript playlist. I installed the 3 files the tutorial says to put on the server, and edited the script with the correct file locations and added those parts to my html, but when I bring up the page, all I see is the player, no playlist. I don't know if I'm missing something or what. Is there somewhere I should be entering the filenames, etc. of the flv files I want to show up in the playlist?

Here is the section of the html for the player and playlist:

<center>
<script type="text/javascript" src="http://www2.umaine.edu/MarchingBand/videos/2009/jquery.js"></script>
<script type="text/javascript" src="http://www2.umaine.edu/MarchingBand/videos/2009/jquery.playlist.js"></script>
<link rel="stylesheet" type="text/css" href="http://www2.umaine.edu/MarchingBand/videos/2009/playlist.css" />

<script type='text/javascript' src='http://www2.umaine.edu/MarchingBand/videos/2009/swfobject.js'></script>

<div id='mediaspace'>This text will be replaced</div>

<script type='text/javascript'>
var so = new SWFObject('http://www2.umaine.edu/MarchingBand/videos/2009/player-viral.swf','mpl','470','320','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('author','University of Maine Marching Band');
so.addVariable('title','UMaine Alumni Band Halftime Show');
so.write('mediaspace');
</script>

Thanks for any help.

Wow, that looks way different than using the script available in the tutorial. I notice in the source for the html page that it is calling on 'playlist_jwchapters.xml'. I don't know anything about xml, and I'm trying to find the easiest way to get a playlist going. If xml is the only way to add the files, I can try to put it together, but wondering if there is something easier.

Thanks.

Actually I just looked at an xml tutorial and it doesn't look too hard. I'm not really concerned with being able to stylize the playlist with css right now, so I can probably just use the playlist included with the player. Could you possibly post a portion of the xml document you use so I can get all the parts I should include?

Thanks again.

My playlist file is here: http://willswonders.myip.org:8074/playlist_jwchapters.xml

See how it's just my domain plus the filename, just like the other files.

The full XML playlist documentation is here: http://developer.longtailvideo.com/trac/wiki/FlashFormats#XMLPlaylists

There are also some sample XML playllist files here: http://developer.longtailvideo.com/trac/browser/testing/files

A simple playlist example page is here: http://willswonders.myip.org:8074/Simple_Playlist.html

Disregard the commented out code, it's a Test Page.

If you get stuck, post a link to your Test Page so someone can help you further.

Thanks for the info. I actually found Charlie Craig's xml generator, so I have a playlist up, but its just showing the name of the file. Is there a way to add a description for each file in the playlist?

My testing page is http://www2.umaine.edu/MarchingBand/videostest2.php

Thanks again.

I will have to find the VBS playlist generator. I am sure that I have added other elements to it.

I am having the same issues as described above but my script looks different. The result is that I get the placeholder for the video and the white space for a playlist but nothing loads and my image doesn't load either. Here is my code:

<script type='text/javascript' src=' http://web.mac.com/deolson/flash/jquery.js'></script>

<script type='text/javascript' src=' http://web.mac.com/deolson/flash/swfobject.js'></script>
<div id="player">
<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">
Get the Adobe Flash Player to see this video.</a></div>
<script type='text/javascript'>
var so = new SWFObject(' http://web.mac.com/deolson/flash/player.swf','mpl','580','300','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('icons','false');
so.addVariable('image',' http://web.mac.com/deolson/flash/Digital_Pastor.png');
so.addVariable('playlist','right');
so.addVariable('file','http://web.mac.com/deolson/flash/playlist.xml');
so.addVariable('playlistsize','180');
so.addVariable('file',' http://web.mac.com/deolson/flash/playlist.xml');
so.write('player');
</script>

opps,

Just saw the error of my ways. I had double entered the
so.addVariable('file',' http://web.mac.com/deolson/flash/playlist.xml'); When I placed it after the playlist size it didn't work but when I put it in front of the size it worked.

David

@hobbs

I'm trying to get this implemented on a landing page I am building. I can't seem to get the video player to show up. I used the files that you posted the links to above. Any help would be greatly appreciated.

My test page link is:
http://www.fuseideas.com/clients/wazi/landingpage/welovewazi.html

I seem to be using the same .js file, and the same css. I tried to recreate the XML just to get it to a point where I could see the video player appear, then swap it out with some of my own videos. Just can't seem to even get it to appear at all.

Thanks.

scratch that. Seems to be working now. Just have to mess around with the styling a little bit!

Some of the Flash players use variables (specifically what I'm trying to do is hide the control bar). If I'm using the code in the working examples above, where would I add these kinds of variables?

Thanks!
Dave

 
Do you mean like this???

<script type='text/javascript'>
var so = new SWFObject(' http://web.mac.com/deolson/flash/player.swf','mpl','580','300','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('icons','false');
so.addVariable('image',' http://web.mac.com/deolson/flash/Digital_Pastor.png');
so.addVariable('playlist','right');
so.addVariable('file','http://web.mac.com/deolson/flash/playlist.xml');
so.addVariable('playlistsize','180');
so.addVariable('file',' http://web.mac.com/deolson/flash/playlist.xml');
<strong>so.addVariable('controlbar','none');</strong>
so.write('player');
</script>

Does anyone know why this doesn't play on IE? The first video seems to play, but the playlist will not show up. Works well on Firefox and Safari.

Hi Noodle,

That looks like the code on some of the tutorial sections,
but I'm using code I found above on this page.

Looks like this:

<script src="http://www.google.com/jsapi"></script>

<script>
google.load('jquery', '1.3.2');
google.load('swfobject', '2.2');
</script>

<script src="jquery.playlist.js"></script>

<script type="text/javascript">
var flashvars =
{
'file': 'playlist_jwchapters.xml',

//...breaks the JavaScript Playlist if hd.state=true
//'file': 'playlist_highfidelityhdtv.xml',
//'plugins': 'http://willswonders.myip.org:8074/hd-1.3',
//'hd.state': 'false',
//'dock': 'true',

'id': 'playerID',
'autostart': 'true'
};

var params =
{
'allowfullscreen': 'true',
'allowscriptaccess': 'always',
'controlbar': 'over',
'bgcolor': '#FFFFFF'
};

var attributes =
{
'id': 'playerID',
'name': 'playerID'
};

//swfobject.embedSWF('player-4.7.581.swf', 'player', '352', '212', '9.0.124', false, flashvars, params, attributes);
swfobject.embedSWF('player-4.7.781.swf', 'player', '320', '241', '9.0.124', false, flashvars, params, attributes);
</script>

Not sure where in this code I would place the control bar variable?

Thanks!

First, off, great thread.

I believe I'm having the same issue as Dave. I'm trying to change the coloring on the player itself and am not having any luck. I'm also a complete novice, so it's entirely possible that I'm not even close to what I should be doing. Here's what I think is my closest to correct attempt:

<script type="text/javascript">
var flashvars =
{
'file': 'http://************.com/hunter/playlist_jwchapters.xml',
'id': 'playerID',
'autostart': 'true',
'backcolor': '555555',
'frontcolor': 'AAAAAA',
'lightcolor': '999999',
'screencolor': '000000'
};

var params =
{
'allowfullscreen': 'true',
'allowscriptaccess': 'always',
'bgcolor': '#444'
};

var attributes =
{
'id': 'playerID',
'name': 'playerID'
};

swfobject.embedSWF('player-licensed.swf', 'player', '640', '380', '9.0.124', false, flashvars, params, attributes);
</script>

Any help would be much appreciated!

I also can't get the playlist to show up on IE. Anyone know why? Plays well in Firefox and Safari and the playlist is perfectly visible. IE shows the video, but ignores the playlist it seems.

My test page is here:
http://www.fuseideas.com/clients/wazi/landingpage/welovewazi.html

Any help would be appreciated as I need to get this up and running soon!

The code I posted above is working now ~ I'm assuming I must have been hitting some sort of cacheing issue earlier. Or else possibly gremlins.

Hunter is yours working in IE? No matter what I do, it just won't work. I'm no js expert, but I assume the problem is somewhere there? Like I said above, works perfect in Firefox and Safari though, so who knows.....

 
@Dave,

See this thread:

    http://www.longtailvideo.com/support/forum/JavaScript-Interaction/19818/Can-t-load-Javascript-Playli...

My post of Jan. 20, 2010

You need to modify jquery.playlist.js for IE + swfobject v2.2.

Thanks Noodle,

I ended up using a YouTube Playlist and switched the player altogether. But I def want to get the previous one working so I will check that link soon.

Thanks for your response. Much appreciated!

@Hobbs
Your link http://willswonders.myip.org:8074/JavaScript%20Playlist.html is not working.
can you post it again? thank you.