özetle şu şekilde fizy deki olay javascript in document.location elementiyle alıyorlar url i
http://fizy.com/#s/1490bs gibi sonra regex le parse ediyorlar.
tabii anlayana
if (document.location.hash.length>1) {
var re = new RegExp(/\/s\//);
var qre = new RegExp(/\/q\//);
if ((document.location.pathname).match(re) || (document.location.pathname).match(qre)) {
document.location.href='/' + document.location.hash;
} else {
var re = new RegExp(/#s\//);
var qre = new RegExp(/#q\//);
if ((document.location.hash).match(re) || (document.location.hash).match(qre)) {
if( (document.location.hash).match(re) ) var playIt=document.location.hash.substr(3);
if( (document.location.hash).match(qre) ) var searchIt=document.location.hash.substr(3);
}else{
document.location.href= '/' + document.location.hash.substr(1);
}
}
}
case 'ready':
fizy.player('playingReady');
if ($('video')) $('video').set('spectrum',{'spectrumcolor':'cccccc'});
if ($('dvideo')) $('dvideo').set('spectrum',{'spectrumcolor':'cccccc'});
fizy.autoplay = 1;
if( song.ID )
fizy.player('play',song);
else if(typeof playIt != "undefined" ){
fizy.player('playById',playIt);
}
fizy.player('hotkeys');
break;
case 'play':
if(fizy.playReq) fizy.playReq.cancel();
if(!fizy.playing)
repeats = false;
else {
if ( fizy.playing.ID == a.ID )
repeats = true;
else
repeats = false;
}
if ( ! repeats ) {
fizy.deactivateListItems();
fizy.loadingListItem( a.ID );
}
fizy.playReq = new Request.JSON({
onCancel: function(s){
fizy.player('playingReady');
fizy.deactivateListItems();
},
onFailure:function(s){
setTimeout("fizy.player('next');", 3000);
},onComplete: function(s){
if(s){
if(typeof s != 'object') {
setTimeout("fizy.player('replay');", 3000);
}
if (s.error == 'noCountry') {
fizy.alert(lang.noCountry);
fizy.player('playingReady');
} else {
if ( ! repeats ) {
fizy.activateListItem( a.ID );
}
fizy.playing = s;
if($('footer').hasClass('close')&&!fizy.IE){
$('footer').fade('hide');
$('footer').removeClass('close');
}
if ($('fzPlayer')) $('fzPlayer').removeClass('close');
if ($('fzdPlayer')) $('fzdPlayer').removeClass('close');
$('footer').fade('in');
//playing icon
if($('songs')) $('songs').getElements('div.pSong').each(function(s){ s.removeClass('playing'); });
if ((fizy.playing) && ($('song'+fizy.playing.ID))) $('song'+fizy.playing.ID).getParent().addClass('playing');
if($('results')) $('results').getElements('div.item').each(function(s){ s.removeClass('playing'); });
if ((fizy.playing) && ($('item'+fizy.playing.ID))) $('item'+fizy.playing.ID).addClass('playing');
// playlist youtube item check
if(s.provider=='youtube' && !fizy.yt ) {
fizy.player('playingReady');
fizy.player('next');
return true;
}else if(s.provider=='metacafe' && !fizy.mt){
fizy.player('playingReady');
fizy.player('next');
return true;
}
if ((!fizy.access) && (s.provider == 'youtube') && (!$('fzPlayer').hasClass('video'))) {
$('fzPlayer').toggleClass('video');
}
if(fizy.html5){
if(s.type == "mp3" && !(s.provider == "muyap" || s.provider == "sony")){
jQuery("#jquery_jplayer").jPlayer( "setFile", s.source ).jPlayer("play");
}else{
fizy.player('next');
return true;
}
}
try {
if ($('video')) $('video').set('load',s);
} catch ( e ) {
// console.log( e );
}
try {
if ($('dvideo')) $('dvideo').set('load',s);
} catch ( e ) {
// console.log( "2" + e );
}
if( fizy.nonPlayedSongs ){
var idx = fizy.nonPlayedSongs.indexOf(fizy.playing.ID); // Find the index
if(idx!=-1) fizy.nonPlayedSongs.splice(idx, 1); // Remove it if really found!
}
$('playingSong').set('html',lang.nowPlaying + s.title);
document.title = unescape(s.title.replace('&', '&').replace('"', '"').replace(''', '\'')) + ' / fizy.';
$('provider').set('src','/themes/'+fizy.theme+'/images/providers/'+s.provider+'.gif?v=5');
$('provider').setStyle("cursor", "auto");
$('provider').removeEvents('click');
fizy.setSlider(a);
if(s.provider == 'soundcloud'){
$('provider').setStyle("cursor", "pointer");
$('provider').addEvent('click', function(){window.open ('/fizy::goToPage::'+s.ID);});
}else if(s.provider == "youtube" && !fizy.video){
fizy.player('video');
}else if(s.provider != "youtube" && fizy.video){
fizy.player('video');
}
if($('ad_120x600')){
fizy.advertisement.load();
}
fizy.tempTimer && clearTimeout(fizy.tempTimer);
fizy.tempTimer = null;
fizy.tempTimer = setTimeout("fizy.player('nowPlaying');",30000);
}
} else {
fizy.deactivateListItems();
fizy.player('playingReady');
}
}
}).post('/fizy::getSong','SID='+a.ID+'&isPlaylist='+a.isPlaylist);
if (!fizy.autoplay) {
fizy.adHit();
if (pageTracker) pageTracker._trackPageview('/fizy::getSong::' + a.ID);
} else fizy.autoplay = 0;
break;