Linking 1pixelout player within each other
mike15 - October 2, 2008 - 06:00
| Project: | Audio |
| Version: | 5.x-2.x-dev |
| Component: | players |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Description
Hi,
I was looking for a way to link the individual "1pixelout Flash players" into a series of files that can maintain the state of one another. So for example, if you have 3 singles, you have 3 players which could be played at the same time. I have seen examples of others that have figured out a way to stop or pause the first player while user listens to the second one.
Thanks,
Mike

#1
At a quick glance, this feels like less of an audio issue, and more the role of a helper module --
Or, if I understand this correctly, this could be achieved using Views, and possibly nodequeue -- drop your audio nodes into a queue, use views to display the player, and you're done.
Changing status to minor, marking as needs more info --
If I misiunderstand the need, please post back with additional info, and ideally a screenshot showing what you'd like to achieve.
#2
I think mike15 was asking if using this audio module allows for posting up more than one instance of the player in the same node. If this is what you're after then from what i know, this is not possible but http://drupal.org/project/asset should allow you to post multiple players.
thanks,
#3
Hi Guys,
Let me try to clarify my original question. I have seen a number of examples on the Internet where 1pixelout players are somehow linked to one another therefore preventing a user from playing two songs at the same time. While listening to a song, the user clicks on the second player play button, the first player stops playing automatically so the songs don't overlap with one other.
Here is the example:
http://www.1pixelout.net/code/audio-player-wordpress-plugin/
Hope this helps a bit
Thanks in advance.
Mike
#4
I have the same issue.
I took a look at that example and at first thought maybe the linking was due to
the same file being used for both instances. I tried this on my own site but
for the second instance I just get a 'sorry flash not available' error instead.
Btw the current top post on the blog over at the 1pixelout site has a similar
question so perhaps an answer will come there.
I did read this from 2007 though:
"Pierre: are you using my player in WordPress? If you aren’t then you are probably missing the javascript file needed for the “automatic closing” feature. At the moment there isn’t a JavaScript API for the player."
#5
I also have an issue with this. I've looked at the page here:
http://www.1pixelout.net/code/audio-player-wordpress-plugin/
It seems that the "id" value is the important bit, within the "object" tag. In the page above, the players have unique ID values within the "object" tag. Each time the play button on a player is pressed, a script is run, which stops all players with an ID that is not the id of that particular player.
On the 1pixelout.net page, there is javascript file in the "head" element which works with the object ids which enables 'automatic closing' feature. This is shown below. I can only diagnose - I'm not competent enough to make this work! I hope someone can make a start from this.
var ap_instances = new Array();
function ap_stopAll(playerID) {
for(var i = 0;i<ap_instances.length;i++) {
try {
if(ap_instances[i] != playerID) document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 1);
else document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 0);
} catch( errorObject ) {
// stop any errors
}
}
}
function ap_registerPlayers() {
var objectID;
var objectTags = document.getElementsByTagName("object");
for(var i=0;i<objectTags.length;i++) {
objectID = objectTags[i].id;
if(objectID.indexOf("audioplayer") == 0) {
ap_instances[i] = objectID.substring(11, objectID.length);
}
}
}
var ap_clearID = setInterval( ap_registerPlayers, 100 );
#6
hi
has this been resolved? i have the same exact problem.
thanks
#7
I am having the same problem, too.