Tremend Tech Blog

"Software is a great combination between artistry and engineering. When you finally get done and get to appreciate what you have done it is like a part of yourself that you've put together." (Bill Gates)

Looking for software experts?

Need an expert advice on software development? Need consulting work done in time and at high standards? Tremend has the right solution for you.

We can provide expertise in:
  • high traffic and complex content website infrastructures
  • website development-advanced web programming with PHP, .NET, Java, Flash/Flex, Ajax

Our friends

Javascript mp3 player

February 12th, 2010 by Marius Hanganu
flash javascript mp3 player

flash javascript mp3 player

Seems impossible, right? Well, it is :-). The title is a bit misleading. You can’t play mp3 in javascript. Not yet at least. Not without a flash object behind the scenes.

But when it comes to searching a flash mp3 player that has also a customizable skin and javascript integration you won’t have so much luck. The players that allow flash - javascript communication are not skinnable, and the ones that are skinnable, don’t allow communication with javascript.

So after a bit of hacking here’s the final result: http://blog.tremend.ro/wp-content/uploads/2010/02/flash-javascript-mp3-player/test.html

The script is based on this excellent flash mp3 player which involves a hidden flash mp3 player. The main headache is actually not the UI which uses a simple scriptaculous effect for scrolling (just drag and drop the cursor to see it working), but actually making sure the commands from javascript to the flash player work on all browsers.

Another bonus feature added is the ability to jump to different sections of the audio file. The sections are described in a javascript configuration object. An UI for this feature can be easily built using your favorite UI framework.

Share/Save

Posted in General, HTML, Javascript | No Comments »