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

Forums

/

Wordpress - Want multiple playlists HOW?

3 replies [Last post]

I have installed Flash Video Player Wordpress Plugin and successfully embeded a playlist as instructed with the following tag:

[flashvideo filename=wp-content/uploads/2008/11/playlist_three.xml /]

I cannot find ANYWHERE on the net, how to interact with the player with Javascript etc from within wordpress.

My aim is to have a player with a combobox picker that the user can choose a playlist, same as this example in the link below (But I want to do this inside a page/post in Wordpress):

http://home5.inet.tele.dk/nyboe/flash/mediaplayer/multipleplaylists.htm

Someone please tell me how to interact with the player from within a wordpress post, do I use HTML tab inside the post or do I have to modify something else like a .php file.

Surely someone out there has interacted with the player in wordpress before !

HELP

I didn't find any decent explanation on this either. The code from the examples of Jeroen's site simply doesn't work in WordPresss. Since i urgently have to get this working on my own site, I use a workaround:
First of all, I'm used to work with the Flash video player plugin from http://www.mac-dev.net/blog/download-flash-video-player-plugin-for-wordpress/
It makes use of Jeroen's player, so that comes close to what we want. However, regarding playlists, mac-dev throws the hot potato back to Jeroen's site because he probably doesn't know what to do with it and this is not abnormal because WordPress and Flashvars are not the best of friends.

Now, a solution: It is a bit cumbersome, but for the time being, it is useful:
In the WP plugin, there is a parameter for recommendations. So if you create an xml file which you call "recommendations.xml" or whatever, and you fill in something similar like:

<recommendations>
<recommendation>
<title>Joomla! Home</title>
<image>http://www.miracletutorials.com/images/logoMT.gif</image>
<link>http://www.joomla.org</link>
</recommendation>
<recommendation>
<title>Miracle Tutorials</title>
<image>http://www.miracletutorials.com/images/logoMT.gif</image>
<link>http://www.videochanneltest.com/videos/vlogit-export2_480x360.flv</link>
</recommendation>
<recommendation>
<title>MooRainbow Homepage</title>
<image>http://www.miracletutorials.com/images/logoMT.gif</image>
<link>http://moorainbow.woolly-sheep.net/</link>
</recommendation>
<recommendation>
<title>Vote for AVR at JED</title>
<image>http://www.miracletutorials.com/images/logoMT.gif</image>
<link>http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,3955/Itemid,35/</link>
</recommendation>
<recommendation>
<title>Raboo Design</title>
<image>http://www.miracletutorials.com/images/logoMT.gif</image>
<link>http://www.raboo.com</link>
</recommendation>
</recommendations>

And then you create a new post in which you write (and it doesn't matter if you use the html or wysiwyg mode):

[flashvideo filename=http://www.yourdomain.com/folder/whatever.flv width=480 height=360 image=http://www.yourdomain.com.com/images/posterimage.jpg recommendations=http://www.yourdomain.com/myplaylist/recommendations.xml /]

Then you will have a video that plays and at the end it will show you a group of icons in the player from which you can send people to other videos or rather other posts which contain video. Now, I agree, this is not the ideal and I do hope someone finds a way to get playlists working, but at least it is a start :-)

Hope this helps!

Hi,

Thanks for the reply I tried the above but for some reason the video played and nothing after. I decided to tinker with JW example code and I can get everything to work okay in a HTML page see code below.

Can you tell me exactly what code I need to put into a post and what code I need to put into an external javascript file for example dropdown_playlist.js?

I read somewhere that I got to put the following code somewhere in the post then I guess I need more code with this to call a function or something that lives in the dropdown_playlist.js ?.....help !!!!

<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript" language="javascript"src="http://www.mydomain.com/blog/scripts/dropdown_playlist.js"></script>
<script type="text/javascript">

1. Here is the HTML code that works fine:

<html>
<head>
<title>JW API Example 5-2-3-0 - JW FLV Media Player</title>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var player = null;
function playerReady(thePlayer) {
player = document.getElementById(thePlayer.id);
}
function createPlayer(thePlayer, theFile) {
var flashvars = {
file:theFile,
autostart:"false",
playlist:"bottom",
playlistsize:"250",
shuffle:"false",
autoscroll:"false",
volume:"50"
}
var params = {
allowfullscreen:"true",
allowscriptaccess:"always"
}
var attributes = {
id:thePlayer,
name:thePlayer
}
swfobject.embedSWF("player.swf", "placeholder1", "480", "620", "9.0.115", false, flashvars, params, attributes);
}
</script>
<style type="text/css">
<!--
.style1 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-weight: bold;
vertical-align: middle;
}
-->
</style>
</head>
<body bgcolor="#DDDDDD" onLoad="createPlayer('player1', 'playlist_mp3.xml')">
<p>
<span class="style1">Select a playlist: </span>
<select name="sel1" onChange="javascript:player.sendEvent('STOP'); player.sendEvent('LOAD', this.value);" style="width:auto;">
<option value="playlist_mp3.xml" selected>MP3</option>
<option value="playlist_mixmedia.xml">Mixed</option>
<option value="playlist_birds.xml">Birds</option>
<option value="playlist_remember.xml">Remember</option>
</select>
<br>
</p>
<div id="placeholder1">
<a href="http://www.adobe.com/go/getflashplayer">Get flash</a> to see this player
</div>
</body>
</html>

Probably, the urls in the xml file are not right. Best use absolute paths. It should work fine. That said, my solution is not a real playlist, of course, it's only a work around.

I'm afraid that I do not know what to put in the javascript because I didn't find any example that worked. I do know that placing javascript directly in a post is not a good idea. Most of the time it is deleted by the system. Joomla tends to do the same.
Therefore, the only way to make sure your code stays, is to put it in the header output.

To put thedropdown_playlist.js in the header on every page:
Go into the admin section, select Design > Theme editor, then locate header.php and add this somewhere after the head tag: <script type="text/javascript" language="javascript"src="http://www.mydomain.com/blog/scripts/dropdown_playlist.js">.

Otherwise, if you only want it in pages where you use the plugin(which is probably better), you can go to Plugins in the admin section, then click Plugin Editor, and then locate Flash Video Player and add it in there, using the echo statement. However, I haven't done this myself and I do not know where exactly you should place it in there. I know a bit of php, but I'm not a real programmer. I was able to add the parameter abouttext in there but tht is about it. However, I'm sure, if you experiment a bit, it will work. Just keep a backup of flash-video-player.php somewhere, in case it goes wrong.

I hope this helps? Sorry, I cannot help you with your other questions.