
Hey.
I have already written twice in Habré about my mashup for listening to music on albums - molpa.ru, on which I am actively working. Today I would like to talk about the innovations on it and the technical aspects of their implementation.
')
Last.fm scrolling
Despite a very simple and pleasant API of last.fm, scrolling in last.fm is somehow separate and, to put it mildly, inconvenient to use, no jsonp and crossdomain here, get regular POST which is not so easy to send by the browser .
The only way I found allowed this was to send POST via a hidden iframe, like this:
$ ( "body" ) . append ( '<div id = "hide"> </ div>' )
. find ( "#hide" ) . html ( "" ) . hide ( )
. append ( '<iframe name = "fm"> </ iframe> <form id = "send" target = "fm" method = "POST" action = "http://ws.audioscrobbler.com/2.0/"> < / form> ' ) ;
for ( n in post ) {
$ ( "#send" ) . append ( '<input name = "' + n + '" value = "' + post [ n ] + '" type = "hidden" />' ) ;
}
$ ( "#send" ) . submit ( ) ;
Quite a stupid way, with quite usable alternatives to it.
HTML5 player
In order to keep up with the times, I decided to install the HTML5 player on the site, with a rollback to flash for old browsers, the first challenger was the
Soundmanager player, but it turned out to be too cumbersome, I plan to optimize the project for mobile browsers, and there such a big thing for what.
Looking for some more time, I took up writing my player, I planned to do it as a handler over the HTML5 object - audio, with full emulation of this object with FLASH, the first version of this creation took only about 5 kilobytes of flash and about as much uncompressed code on js, I was just in awe. ActionScript - turned out to be a rather uncomplicated and pleasant language.
But once during the revision of my player, studying various materials on JS and AS, I came across a ready-made
player that does the same thing in principle, what I wanted to do in my own, and was well documented. In the end, I decided not to finish writing my bike, but to use a ready-made solution.
Future plans
My plans now include the drawing of a new universal interface that can be equally convenient to use both in mobile browsers and PC browsers.
I also plan to start optimizing my code, I would like to simultaneously reduce its size and increase performance, or at least find the perfect balance :)
I hope my experience was a little useful to you;)