Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Controlling PremiumBeat mp3 player from JavaScript

Posted on 2011-10-01
5
Medium Priority
?
720 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
[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
  • 3
  • 2
5 Comments
 
LVL 82

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 82

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 82

Expert Comment

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses

636 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