Solved

Changing a flash MP3 player's play list

Posted on 2010-08-17
5
289 Views
Last Modified: 2012-05-10
I've built a site to present a portfolio of music. Each separate music track has its own page with a built-in flash player that I made myself in AS3. An example of one of the pages can be seen here:

http://xoundboy.com/cfm/recDetailsP.cfm?recID=406

On each page load an XML file is dynamically written containing the filename of the appropriate MP3 file to play. The flash player then loads the XML file and subsequently loads the correct MP3 file.

I would now like to build a floating flash MP3 player that opens in a new window and replace the current built-in player with an "add to playlist" link. Clicking this link will append the current music track to the end of the floating player's playlist. The advantage of this would be that visitors can browse the site listening to music without interruption - currently browsing to a new page stops the current track from playing.

I'm fairly sure I can build most of this but being a Flash novice I'm not sure how I can push each new file into the playlist. Should I use ajax on the 'add to playlist' link to update the playlist.xml file on the server and then use some data pushing server program to push the new playlist back to the flash player? Or is there an easier way that doesn't require any serverside intervention I've no idea where to start with this? Any ideas greatly appreciated.
0
Comment
Question by:xoundboy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 1

Expert Comment

by:zimbix
ID: 33453993
You could use a frameset to keep the flash mp3 player object active at all times (it doesn't even have to be visible)
e.g.:
index.htm containing the frameset and including the following:
     -player.htm containing the player object
     -nav.htm where they can browse the rest of your website
0
 
LVL 2

Author Comment

by:xoundboy
ID: 33454355
thanks but I think you missed the point of the question... how would that solve the problem of the flash player knowing that a new file had been placed into the queue?

At the moment I can only think that I could use something like setinterval(100,checkForNewXML) in the actionscript to see whether the XML file had changed. This is going to mean lots of traffic between client and server.
0
 
LVL 2

Accepted Solution

by:
xoundboy earned 0 total points
ID: 33462164
I think I've found a client-side solution using Flash Shared Objects (Flash Cookies).

I'm making the 'add to playlist' button a flash button which reads the XML file and writes out the track name, artist name file name, etc to a flash shared object  which can then be re-read every half second by the floating player  using setinterval(500, reloadPlaylist). I reckon this is a lot simpler than sending stuff back to the server.
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 34059424
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question