?
Solved

Controlling PremiumBeat mp3 player from JavaScript

Posted on 2011-10-01
5
Medium Priority
?
724 Views
Last Modified: 2012-05-12
Does anyone know how I can control the PremiumBeat Multiple Tracks mp3 player from JavaScript?  I'd like to issue a play() command, and better still, a play(n) command where n is the nth song in the xml playlist.

Thanks for any ideas.
Steve
0
Comment
Question by:steva
  • 3
  • 2
5 Comments
 
LVL 83

Expert Comment

by:leakim971
ID: 36897356
http://www.premiumbeat.com/flash_music_players

Hello steva,

To allow javascript to interact with flash function you need to have somee function with ExternalInterface class in the flash program :
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html
http://www.switchonthecode.com/tutorials/flex-javascript-basics-using-externalinterface

You don't have theses classes inside the PremiumBeat mp3 player so you can't control the player with javascript.

You may use an other flash player :
http://flowplayer.org/plugins/streaming/audio.html
http://www.longtailvideo.com/players/jw-flv-player/

Best Regards
0
 

Author Comment

by:steva
ID: 36898117
Hi Leakim,

Yes, I'm aware of the ExternalInterface and that was my concern, that the PremiumBeat player hadn't enabled it and so there would be no way to control the player from JavaScript.  Recall that you and I went through this a couple of years ago when I needed to control a Flash video player from JavaScript and I ended up writing my own player with the ExternalInterface enabled.  I suspect I will end up converting that player now to an audio player to get the job done.

How did you know that the PremiumBeat player didn't have ExternalInterface enabled?  I was just guessing.

One more thing.  I liked the PremiumBeat player because the sound was superb, but I'm thinking that the sound quality of a Flash mp3 player  is really up to codecs in Flash and so any mp3 player I do with the latest Flash would  have the same excellent sound, as long as I feed it a 256kbs, or higher, mp3.  Is that your understanding?

Good to talk to you again.

Steve






0
 
LVL 83

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 36898185
>How did you know that the PremiumBeat player didn't have ExternalInterface enabled?  I was just guessing.
You may use swf class explorer, for example : http://flassari.is/2008/07/swf-class-explorer-for-as3/

Concerning the quality of the sound, I'm sure other flash players can provide same quality, each player is "only" a set of function, templates and graphics, the adobe flash plugin itself do the job of playing the song.

If you really want to use the premiumbeat plugin, I saw it's difficult to protect file from decompiling : http://active.tutsplus.com/tutorials/workflow/protect-your-flash-files-from-decompilers-by-using-encryption/
0
 

Author Comment

by:steva
ID: 36899050
Thanks for the information, Leakim.

Yes, I've verified that other players have the same quality as the PremiumBeat player, including QuickTime.  You just have to give them all a  256kbps mp3 to get the quality.

My reason for using Flash was so that I could control the player from JavaScript, once I built a player with the ExternalInterface class.  But it turns out that the Quick Time player can already be controlled from JavaScript. And since it's quality is as good as Flash, that's the route I'm taking. Plus, it has excellent documentation from Apple.

Thanks for the discussion, Leakim.  I gave you the points.
0
 
LVL 83

Expert Comment

by:leakim971
ID: 36899255
Thank you, have a nice sunday, see you soon.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

840 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