Saturday, May 7, 2011

Re: [BLUG] Music for Naught: My first attempt at a non-school programming project

I find the biggest PITA with Actionscript is integrating it with a site. You can have an Actionscript function trigger a Javascript function and vice versa, but having to work in both the Flash SDK and your text editor of choice while tweaking the two things is super annoying, as is recompiling and reuploading your Flash SWF whenever you want to test a change. Keeping everything in one world (Javascript) is definitely nice...

If you are interested in learning more Javascript, I might recommend taking a look at YUI (http://developer.yahoo.com/yui/3/) too, this is what I'm using for as much as I can these days, pretty much. jQuery seems to be the framework of choice for building simple little widgets such as slideshows and rotating banners and stuff, and there are a lot of these to choose from, but you sort of have to install these yourself and hope that they integrate nicely with what you are doing. YUI is a framework designed for full-fledged app development.

YUI provides a whole structure for developing widgets and includes a great lazy loader to dynamically load these widgets off the Yahoo server as needed, including prerequisites that are needed. In fact, not only widgets are handled this way, but a lot of core functionality is as well - you add the link to the seed file in your document's head tag (which can be local or accessed from Yahoo's CDN), and you just indicate what components should be loaded dynamically within your Javascript.

The main value of YUI I find is that if you want to use the data table widget, the imageloader, the rich text editor, the uploader tool that provides a progress bar, or any of the tools/components included via the above URL, you basically just learn one syntax and way of doing things and all of these components will comply by this. There is an entire gallery of third party widgets that do the same. I would say that YUI's learning curve is higher because of this, but the framework is generally more powerful, and if you start to rely on these widgets and things, it makes it easy to build stuff really quickly. YUI will do everything that jQuery does, the only upsides to jQuery that I'm aware of is being easier to jump into, and the existence of many simple little widgets (some are also written in Prototype.js, which is another framework that does some of the same things). If you are interested in app development, YUI is definitely a good choice because of not having to integrate different programming styles and initialization techniques and such..

You don't have to stew over committing to one or the other as if it is a one-way street though, you can include jQuery stuff in your YUI projects and vice versa. Because the two sets of classes operate (or can operate) under their namespaces they shouldn't interfere with each other. If anything in that list looks like it would be useful, I'd learn some YUI, because like I said once you "get it", it is easy to incorporate all of those components without having to wrestle an overwhelming learning curve.

Just my two cents!




Ben Shewmaker
May 7, 2011 11:21 PM

Thanks for the feedback, and yeah, I'm not really a big fan of flash especially now that there are much better methods out there for serving audio.  Learning some jquery, javascript, and ajax is next on my free time to do list.  Now that I have some basic PHP down I can work on some of that stuff.  Plus, just glancing at jPlayer it looks so much more tweakable to fit whatever I'd like it to do where this flash player (which I believe is pretty old itself) is quite rigid. 

Ben


_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug


Joe Auty
May 7, 2011 4:51 PM

Whoops... Reading your blog post I can see that you're already hip to jPlayer. Sorry!

I do like the whole directory browsing thing, that is an interesting and useful feature :)



_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug


Joe Auty
May 7, 2011 4:19 PM

Hey Ben!

Congrats on this project!

Have you considered about an HTML5 version of this? My favorite player is jPlayer (http://jplayer.org/), because it supports making your own HTML5 player for browsers that support this, as well as a Flash fallback for those that don't. The Flash fallback does not require the UI to be assembled in the Flash SDK, the buttons are all HTML/CSS/Javascript in both HTML5/Flash playback modes.

As a web developer, unless you are deeply entrenched in Flash (I'm not), not having to skin a player inside Flash simply being able to use HTML/CSS is definitely a plus. This site is a work-in-progress, but here is an implementation of jPlayer with my own tweaks and customizations:

http://musicromm.netmusician.org


I'm not suggesting that you make a jPlayer clone, but leaving the reliance on Flash to a minimum I think would be a plus. As you know, one obvious reason for this is that your player will not work on iOS devices at all, and from what I understand Flash kind of sucks balls on Android devices too in terms of its performance/battery strain.



_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug


Ben Shewmaker
May 7, 2011 2:51 PM

Hi everybody,

Between classes, I was attempting to teach myself some PHP this last
semester, and to test out my skills, I've been working on a simple
(actually, really really simple) little web based music player
(perhaps browser is a better term) project off and on. I think I've
finally reached a point where it is usable and so have uploaded the
project for others to poke around at. If anyone is interested, I'd
love some feedback on the little project as a whole, or, especially,
any comments on the code. What things did I do totally stupidly?
What things work but could be more efficient? What things don't work
at all? There's still so much I don't know so having others poke
around at my code (I hope) will give me some ideas on where/how to
improve.

I've only tested it on one server and so have no idea if it will work
at all on other systems and configurations. You can get more
info/download/view a demo here:
http://www.shewbox.org/music-for-naught/

Thanks!

Ben Shewmaker

p.s. I kinda suck at CSS, so it looks rather bad in IE. It looks
fine in Chrome, Firefox and Safari (haven't tried it in Opera yet).
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug



--
Joe Auty, NetMusician
NetMusician helps musicians, bands and artists create beautiful, professional, custom designed, career-essential websites that are easy to maintain and to integrate with popular social networks.
www.netmusician.org
joe@netmusician.org

No comments: