Click here to Skip to main content
6,634,665 members and growing! (15,524 online)
Email Password   helpLost your password?
Web Development » Custom Controls » General     Intermediate

MP3 Player Server Control

By Andrew Boisen

Using Flash MX to create a server control for easily playing MP3s.
C#, Windows, .NET 1.0, .NET 1.1, ASP.NET, VS.NET2003, Dev
Posted:7 Sep 2003
Views:161,630
Bookmarked:90 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
26 votes for this article.
Popularity: 5.69 Rating: 4.02 out of 5
4 votes, 15.4%
1

2
1 vote, 3.8%
3
4 votes, 15.4%
4
17 votes, 65.4%
5

Screenshot

Introduction

I find a lot of .NET programmers often don't have much experience or knowledge of Flash and it's capabilities. One of the exciting features of Flash MX was that flash files could very easily load external MP3 files and control their playback. I decided that I would implement some of my Flash skills into making a control to sit in my Visual Studio Toolbox that I could easily drag and drop into any project and not have to worry about implementing the resource files. One of the features I worked on was having the Flash file self-contained within the DLL, and having the control intelligently deposit a copy of the Flash file into the appropriate directory, without the programmer having to worry about implementation or setup. Of course, I also liked the idea of using the property panel of Visual Studio to configure my Flash file in a no fuss, error-free manner. So I strived to make the control adaptable, with properties for console UI, looping, streaming and etcetera.

Using the PseudoMP3 server control

Of course, if your using an IDE like Visual Studio, you don't really need to know how to register or what the property names are. But for the sake of clarity...

The very first thing you need is to register the tag prefix.

<%@ Register TagPrefix="pseudoengine" Namespace="PseudoEngine" 
               Assembly="PseudoMp3" %>

Then you can create the control like so...

<pseudoengine:PseudoMP3 
    id="PseudoMP31" 
    runat="server" 
    Src="http://www.myDomain.com/myMp3.mp3"
    Stream="False" 
    AutoStart="False" 
    Loop="False" 
    Console="True">
</pseudoengine:PseudoMP3>

Properties explanation

  • Src: URL location of the MP3 file.
  • Stream: Boolean value to indicate whether MP3 file should be streamed. (Otherwise file is preloaded)
  • AutoStart: Boolean value to indicate whether file should start when page loads. (Guaranteed to annoy or your money back)
  • Loop: Boolean value to indicate whether file should play itself again when it ends.
  • Console: Boolean value to indicate whether to display the UI.

What's in the source files

Everything. The Flash source files, Visual Studio solution, a test harness web app and all the burritos you can eat. Well, maybe not the burritos.

Conclusion

Since I've finished this control, I've actually thought of a few extensions I could implement. It wouldn't be that hard to have the control generate an XML document describing a play list and feed it to the Flash file. You could also add properties to control the initial volume, start position of the track and specific number of loops to have the MP3 playback. Even maybe detect the ID3 metadata and feed the Flash file with the correct title of the song to display. Anyway, I'm bored with this project, so on to the next one.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Andrew Boisen


Member
Name: Andrew Boisen
Occupation: .NET Senior Analyst Programmer
Interests: Writing, Anime, Art, Bonsai
Dislikes: Infomercials, Alpha Males and TeleMarketers
Favourite Artist: Boris Vallejo
Favourite Books: Ender's Game, Hyperion, Cabal
Favourite Authors: Peter Hamilton, Terry Pratchett, Clive Barker
Things I want to do in the next five years: Get published, have kids and smoke some crack.

Occupation: Web Developer
Location: Australia Australia

Other popular Custom Controls articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 62 (Total in Forum: 62) (Refresh)FirstPrevNext
QuestionDon't know how to use PseudoMP3 library Pinmemberagehacker10:06 8 Nov '09  
GeneralLicense required? PinmemberRichard Mikesell20:47 1 Nov '09  
Generalhow to control from asp button Pinmemberdave70770712:38 28 Oct '09  
GeneralComercial licence Pinmembertetabara4:07 29 Aug '09  
GeneralBuffer Size PinmemberMember 44614333:30 19 Aug '09  
GeneralMy vote of 1 Pinmemberbabakzawari11:41 17 Aug '09  
QuestionPlay list PinmemberFaizan4:54 25 Jun '09  
GeneralFULL TRUST problem? deploying to godaddy problem Pinmemberjimkqui18:18 17 Mar '09  
GeneralRe: FULL TRUST problem? deploying to godaddy problem PinmemberMember 446143311:47 25 Aug '09  
GeneralHai Andrew Boisen PinmemberAnu Palavila21:29 30 Oct '08  
GeneralThe player won't play my mp3's PinmemberKarim Hadj Abderrahman13:43 20 Sep '08  
GeneralRe: The player won't play my mp3's Pinmembertinomclaren4:09 24 Sep '08  
GeneralRe: The player won't play my mp3's PinmemberKarim Hadj Abderrahman6:30 26 Sep '08  
Generalplaying files located on a network share Pinmemberlukikul23:26 29 Jul '08  
GeneralRe-building the dll PinmemberFollowTheSon7:51 7 Feb '08  
QuestionWant to have control over place from where it plays? PinmemberRahul N3:47 4 Jun '07  
GeneralRe: Want to have control over place from where it plays? PinmemberMyLabRuby5:25 14 Apr '08  
QuestionUsing the control for comercial purpose PinmemberSujeet754:26 4 Apr '07  
AnswerRe: Using the control for comercial purpose PinmemberAndrew Boisen13:05 4 Apr '07  
GeneralRe: Using the control for comercial purpose PinmemberThe Haven2:04 5 Apr '07  
GeneralRe: Using the control for comercial purpose Pinmemberpanuvin19:34 13 Sep '07  
QuestionRe: Using the control for comercial purpose PinmemberSujeet7523:21 12 Apr '07  
Questionstruggling to upload into my application PinmemberThe Haven1:02 4 Apr '07  
AnswerRe: struggling to upload into my application PinmemberThe Haven1:58 4 Apr '07  
QuestionChanged the Flash File Pinmember10:48 8 Jan '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 7 Sep 2003
Editor: Smitha Vijayan
Copyright 2003 by Andrew Boisen
Everything else Copyright © CodeProject, 1999-2009
Web10 | Advertise on the Code Project