summaryrefslogtreecommitdiffstats
path: root/modules/flash
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-10-15 08:04:43 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-10-15 08:04:43 +0000
commit0f0ec52f25badff588468177b3e80c10c92b3a30 (patch)
treedd49bf6fb67ea6d16dcd5faf09d7f2fd5d78f6d4 /modules/flash
parentba62ca14b91934d9f5d81ff3a29fcf434acd1fdc (diff)
downloadampache-0f0ec52f25badff588468177b3e80c10c92b3a30.tar.gz
ampache-0f0ec52f25badff588468177b3e80c10c92b3a30.tar.bz2
ampache-0f0ec52f25badff588468177b3e80c10c92b3a30.zip
switched to lacy morrows flash player, allows skinning.. (Thx hugoh)
Diffstat (limited to 'modules/flash')
-rw-r--r--modules/flash/LICENSE10
-rw-r--r--modules/flash/Original/skin.xml37
-rw-r--r--modules/flash/crossdomain.xml6
-rw-r--r--modules/flash/extended.swfbin62005 -> 0 bytes
-rw-r--r--modules/flash/xspf_jukebox.swfbin0 -> 17884 bytes
-rw-r--r--modules/flash/xspf_player.as1
-rw-r--r--modules/flash/xspf_player.flabin324096 -> 0 bytes
-rw-r--r--modules/flash/xspf_player.swfbin62005 -> 0 bytes
8 files changed, 53 insertions, 1 deletions
diff --git a/modules/flash/LICENSE b/modules/flash/LICENSE
new file mode 100644
index 00000000..12820eee
--- /dev/null
+++ b/modules/flash/LICENSE
@@ -0,0 +1,10 @@
+Copyright (c) 2007, Lacy Morrow
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/modules/flash/Original/skin.xml b/modules/flash/Original/skin.xml
new file mode 100644
index 00000000..519ff103
--- /dev/null
+++ b/modules/flash/Original/skin.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?> <skin version="0" xmlns="http://xsml.org/ns/0/">
+<width>400</width>
+<height>170</height>
+<name>
+Original </name> <author>
+Lacy Morrow </author>
+<email>
+gojukebox@gmail.com </email> <website>
+http://www.lacymorrow.com </website> <objects>
+<shape shape="rectangle" width="400" height="15" color="EAEAEA" />
+<shape shape="rectangle" width="248" height="138" x="138" y="17" color="EAEAEA" />
+<shape shape="rectangle" width="10" height="144" x="388" y="17" color="EAEAEA" />
+<shape shape="rectangle" width="134" height="134" x="2.4" y="17.4" color="EAEAEA" />
+<shape shape="rectangle" width="44" height="14" x="5" y="154" color="EAEAEA" />
+<shape shape="rectangle" width="50.2" height="13" x="56" y="155" border="2" borderColor="999999" color="EAEAEA" />
+<shape shape="rectangle" width="25.8" height="13" x="110" y="155" border="2" borderColor="999999" color="EAEAEA" />
+<object label="playButton" x="19" y="3" width="9" height="9" color="999999" />
+<object label="stopButton" x="32" y="3" width="8" height="9" color="999999" />
+<object label="prevButton" x="3" y="3" width="11" height="9" color="999999" />
+<object label="fwdButton" x="46" y="3" width="11" height="9" color="999999" />
+<object label="loadBar" x="62" y="2" width="335" height="11" alpha="80" color="BBBBBB" />
+<object label="timeBar" x="62" y="2" width="335" height="11" alpha="70" color="999999" />
+<object label="trackDisplay" x="64" y="" width="280" size="10" font="Arial" color="333333" align="left" />
+<object label="timeDisplay" x="350" y="" size="10" font="Arial" color="333333" />
+<object label="volumeDisplay" x="380" y="4" width="15" height="7" color="444444" />
+<object label="shuffleButton" x="7" y="155" width="20.7" height="11.7" color="333333" hoverMessage="Shuffle" />
+<object label="repeatButton" x="34" y="156" width="15.7" height="11.7" color="333333" hoverMessage="Repeat" />
+<object label="infoButton" x="112" y="154" size="-2" color="333333" text="info" font="Arial" hoverMessage="Info" />
+<object label="purchaseButton" x="58" y="153" size="-2" color="333333" text="purchase" font="Arial" hoverMessage="Purchase" />
+<object label="downloadButton" x="56" y="153.5" size="-2" color="333333" text="Download" font="Arial" />
+<object label="scrollupButton" x="391" y="22" width="6" height="6" color="888888" /> <object label="scrolldownButton" x="391" y="31" width="6" height="6" color="888888" /> <object label="scrollButton" x="391.2" y="40" width="6" height="120" color="888888" bgAlpha="0" />
+<object label="imageDisplay" x="4" y="20" width="130" height="130" />
+<object label="videoDisplay" x="4" y="20" width="130" height="130" />
+<playlist x="140" y="17" width="243" height="136" size="10" font="Arial" color="333333" />
+<text x="374" y="142" size="10" text="@" bold="1" color="333333" hoverMessage="About the Jukebox..." url="http://blog.lacymorrow.com" />
+<object label="startButton" width="400" height="170" alpha="0" />
+</objects> </skin> \ No newline at end of file
diff --git a/modules/flash/crossdomain.xml b/modules/flash/crossdomain.xml
new file mode 100644
index 00000000..9f8d775d
--- /dev/null
+++ b/modules/flash/crossdomain.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE cross-domain-policy
+ SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
+<cross-domain-policy>
+ <allow-access-from domain="*" />
+</cross-domain-policy> \ No newline at end of file
diff --git a/modules/flash/extended.swf b/modules/flash/extended.swf
deleted file mode 100644
index 8198b8d3..00000000
--- a/modules/flash/extended.swf
+++ /dev/null
Binary files differ
diff --git a/modules/flash/xspf_jukebox.swf b/modules/flash/xspf_jukebox.swf
new file mode 100644
index 00000000..78c7fc81
--- /dev/null
+++ b/modules/flash/xspf_jukebox.swf
Binary files differ
diff --git a/modules/flash/xspf_player.as b/modules/flash/xspf_player.as
deleted file mode 100644
index 3b359cf5..00000000
--- a/modules/flash/xspf_player.as
+++ /dev/null
@@ -1 +0,0 @@
-/* Copyright (c) 2005, Fabricio Zuardi All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* This is the XSPF music player, modified by www.jamendo.com We hope some patches will make it to the main repository */ stop(); // // Simple function for default values // initVar=function(variable,dftvalue,vartype) { if (!variable) { return dftvalue; } else if (vartype=="boolean" && (variable=="true" || variable=="1")) { return true; } else if (vartype=="boolean" && (variable=="false" || variable=="0")) { return false } else if (vartype=="integer") { return parseInt(variable); } else { return variable; } } // // Set the default parameters // autoload = true; autoload_image = initVar(autoload_image,true,"boolean"); autoplay = initVar(autoplay,false,"boolean"); repeat_playlist = initVar(autoplay,true,"boolean"); playlist_size = initVar(playlist_size,false,"integer"); player_title = initVar(player_title,"Jamendo Playlist - XSPF Music Player"); song_url = initVar(song_url,false); //song_url = "http://downloads.betterpropaganda.com/music/Imperial_Teen-Ivanka_128.mp3"; song_title = initVar(song_title,false); //song_title = "Imperial Teen - Ivanka"; playlist_url = initVar(playlist_url,false); //playlist_url = "http://cchits.ning.com/recent/xspf/?xn_auth=no"; //playlist_url = "http://hideout.com.br/shows/radio-test.xspf"; //playlist_url = "http%3A%2F%2Fwebjay%2Eorg%2Fby%2Flucas%5Fgonze%2Flaconic%2Exspf" //playlist_url= "http://hideout.com.br/tests/hideout2325.xspf" //playlist_url = "http://www.jamendo.com/get/track/id/album/audio/xspf/116/?aue=mp31"; //playlist_url="default.xspf"; playlist_title = initVar(playlist_title,"Jamendo Playlist"); radio_mode = initVar(radio_mode,false,"boolean"); info_button_text = initVar(info_button_text,"More on Jamendo.com"); info_button_target = initVar(info_button_target,"_top"); loading_playlist_msg = initVar(loading_playlist_msg,"Loading Playlist..."); loaded_playlist_msg = initVar(loaded_playlist_msg,"- click to start"); //by default, play the popular jamendo songs DEFAULT_PLAYLIST_URL = "http://www.jamendo.com/get/track/list/album/audio/xspf/?aue=mp31&n=100&o=rating_month_desc"; //playlists has priority over songs, if a playlist_url parameter is found the song_url is ignored //default playlist if none is passed through query string if(!playlist_url){ if(!song_url){ playlist_url = DEFAULT_PLAYLIST_URL; }else{ single_music_playlist = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><playlist version=\"1\" xmlns = \"http://xspf.org/ns/0/\"><trackList>"; single_music_playlist += "<track><location>"+song_url+"</location><annotation>"+song_title+"</annotation></track>"; single_music_playlist += "</trackList></playlist>"; } } info_mc._visible=false; info_mc.display_txt.text = info_button_text; //variables initialization playlist_array = []; track_index = 0; playlist_mc.track_count = 0; pause_position = 0; volume_level = 100; playlist_xml = new XML(); playlist_xml.ignoreWhite = true; playlist_xml.onLoad = playlistLoaded; mysound = new Sound(this); playlist_listener = new Object(); playlist_list.addEventListener("change", playlist_listener) //play_btn.onPress = playTrack; //functions //xml parser function playlistLoaded (success){ if(success){ var root_node = this.firstChild; for(var node = root_node.firstChild; node != null; node = node.nextSibling){ if(node.nodeName == "title"){ playlist_title = node.firstChild.nodeValue; } if(node.nodeName == "trackList"){ //tracks var tracks_array = []; for(var track_node = node.firstChild; track_node != null; track_node = track_node.nextSibling){ var track_obj = new Object() //track attributes for(var track_child = track_node.firstChild; track_child != null; track_child = track_child.nextSibling){ if(track_child.nodeName=="location"){ track_obj.location = track_child.firstChild.nodeValue } if(track_child.nodeName=="image"){ track_obj.image = track_child.firstChild.nodeValue } if(track_child.nodeName=="title"){ track_obj.title = track_child.firstChild.nodeValue } if(track_child.nodeName=="creator"){ track_obj.creator = track_child.firstChild.nodeValue } if(track_child.nodeName=="annotation"){ track_obj.annotation = track_child.firstChild.nodeValue } if(track_child.nodeName=="info"){ track_obj.info = track_child.firstChild.nodeValue } } track_obj.label = (tracks_array.length+1) +". "; if(track_obj.title) { if(track_obj.creator) { track_obj.label += track_obj.creator+' - '; } track_obj.label += track_obj.title; } else { track_obj.label += track_obj.annotation; } tracks_array.push(track_obj) addTrack(track_obj.label); } } } playlist_array = tracks_array; if(!playlist_size) playlist_size = playlist_array.length; playlist_mc.tracks_mc["track_"+track_index+"_mc"].bg_mc.gotoAndStop(2) if (autoload_image && playlist_size>0) { loadCover(0); } if(autoplay){ loadTrack() }else{ start_btn_mc.start_btn.onPress = loadTrack; track_display_mc.display_txt.text = playlist_title+" "+loaded_playlist_msg; if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){ track_display_mc.onEnterFrame = scrollTitle; }else{ track_display_mc.onEnterFrame = null; track_display_mc.display_txt._x = 0; } } }else{ annotation_txt.text = "Error opening "+playlist_url; } } playlist_listener.change = function(eventObject){ annotation_txt.text = playlist_list.selectedItem.annotation; location_txt.text = playlist_list.selectedItem.location; } // Define an improved loadMovie() method // MovieClip.prototype.loadMovieWithEvents = function(url, vars) { if (this.onData != undefined && this.onData != null) { this._parent.createEmptyMovieClip("__fixEvents", 7777); this._parent.__fixEvents.theTarget = this; this._parent.__fixEvents.onData = this.onData; if (this.onLoad != undefined && this.onLoad != null) { this._parent.__fixEvents.onLoad = this.onLoad; } this._parent.__fixEvents.onEnterFrame = function() { this.oldv = this.v; this.v = this.theTarget.getBytesLoaded(); if (this.v != this.oldv) { this.onData.call(this.theTarget); } if (this.v == this.theTarget.getBytesTotal() && (this.theTarget._width>0) && (this.theTarget._height>0)) { this.theTarget.onData = this.onData; if (this.onLoad != undefined) { this.theTarget.onLoad = this.onLoad; } this.onLoad.call(this.theTarget); this.removeMovieClip(); } }; } this.loadMovie(url, vars); }; function loadCover(ti) { if (last_track_index==undefined) { var test_last_track_index = 0; } else { var test_last_track_index = last_track_index; } //don't reload the cover it if's the same. if(playlist_array[ti].image!=undefined && playlist_array[ti].image==cover_mc.content_mc["photo"+test_last_track_index]._url) { cover_mc.content_mc["photo"+ti]=cover_mc.content_mc["photo"+test_last_track_index]; } else { cover_mc.content_mc["photo"+test_last_track_index].removeMovieClip(); //track cover if(playlist_array[ti].image!=undefined){ cover_mc.content_mc.createEmptyMovieClip("photo"+ti,ti) //display a progress bar cover_mc.content_mc["photo"+ti].onData=function() { var image_load_percent = (cover_mc.content_mc["photo"+ti].getBytesLoaded()/cover_mc.content_mc["photo"+ti].getBytesTotal())*100 cover_mc.load_bar_mc._xscale = image_load_percent; } //scale the cover when loaded cover_mc.content_mc["photo"+ti].onLoad=function() { cover_mc.content_mc["photo"+ti]._width = cover_mc.load_bar_mc._width cover_mc.content_mc["photo"+ti]._height = cover_mc.load_bar_mc._height } cover_mc.content_mc["photo"+ti].loadMovieWithEvents(playlist_array[ti].image) } } //info button if(playlist_array[ti].info!=undefined){ info_mc._visible = true; info_mc.info_btn.onPress = function(){ getURL(playlist_array[ti].info,info_button_target); } cover_mc.onPress = function() { getURL(playlist_array[ti].info,info_button_target); } }else{ info_mc._visible = false; } } function loadTrack(){ //Radio Mode feature by nosferathoo, more info in: https://sourceforge.net/tracker/index.php?func=detail&aid=1341940&group_id=128363&atid=711474 if (radio_mode && track_index==playlist_size-1) { playlist_url=playlist_array[track_index].location; for (i=0;i<playlist_mc.track_count;++i) { removeMovieClip(playlist_mc.tracks_mc["track_"+i+"_mc"]); } playlist_mc.track_count=0; playlist_size=0; track_index=0; autoload=true; autoplay=true; loadPlaylist(); return(0); } start_btn_mc.start_btn._visible = false; track_display_mc.display_txt.text = playlist_array[track_index].label; if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){ track_display_mc.onEnterFrame = scrollTitle; }else{ track_display_mc.onEnterFrame = null; track_display_mc.display_txt._x = 0; } mysound.loadSound(playlist_array[track_index].location,true); play_mc.gotoAndStop(2) //image from playlist loadCover(track_index) _root.onEnterFrame=function(){ //HACK doesnt need to set the volume at every enterframe mysound.setVolume(this.volume_level) var sound_load_percent = (mysound.getBytesLoaded()/mysound.getBytesTotal())*100 track_display_mc.loader_mc.load_bar_mc._xscale = sound_load_percent; } } stop_btn.onRelease = stopTrack; play_mc.play_btn.onRelease = playTrack next_btn.onRelease = nextTrack prev_btn.onRelease = prevTrack mysound.onSoundComplete = nextTrack; volume_mc.volume_btn.onPress = volumeChange; volume_mc.volume_btn.onRelease = volume_mc.volume_btn.onReleaseOutside = function(){ this._parent.onMouseMove = this._parent.onMouseDown = null; } function volumeChange(){ this._parent.onMouseMove = this._parent.onMouseDown = function(){ var percent = (this._xmouse/this._width)*100 if(percent>100)percent=100; if(percent<0)percent=0; this.volume_bar_mc._xscale = percent this._parent.volume_level = percent; mysound.setVolume(percent) } } function stopTrack() { mysound.stop(); play_mc.gotoAndStop(1) mysound.stop(); mysound.start(); mysound.stop(); _root.pause_position = 0; }; function playTrack() { if(play_mc._currentframe==1){ //play seekTrack(_root.pause_position) play_mc.gotoAndStop(2) }else if(play_mc._currentframe==2){ _root.pause_position = mysound.position; mysound.stop(); play_mc.gotoAndStop(1) } }; function seekTrack(p_offset:Number){ mysound.stop() mysound.start(int((p_offset)/1000),1) } function nextTrack(){ if(track_index<playlist_size-1){ last_track_index = track_index; track_index ++; loadTrack(); }else{ if(repeat_playlist){ last_track_index = track_index; track_index = 0; loadTrack() } } playlist_mc.tracks_mc["track_"+last_track_index+"_mc"].bg_mc.gotoAndStop(1) playlist_mc.tracks_mc["track_"+track_index+"_mc"].bg_mc.gotoAndStop(2) } function prevTrack(){ if(track_index>0){ last_track_index = track_index; track_index --; loadTrack(); } playlist_mc.tracks_mc["track_"+last_track_index+"_mc"].bg_mc.gotoAndStop(1) playlist_mc.tracks_mc["track_"+track_index+"_mc"].bg_mc.gotoAndStop(2) } function scrollTitle(){ track_display_mc.display_txt._x -= 5; if (track_display_mc.display_txt._x+track_display_mc.display_txt._width<0){ track_display_mc.display_txt._x = track_display_mc.mask_mc._width; } } function resizeUI(){ bg_mc._width = Stage.width; track_display_mc.loader_mc._width = Stage.width - track_display_mc._x - 2; track_display_mc.mask_mc._width = track_display_mc.loader_mc._width-3; if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){ track_display_mc.onEnterFrame = scrollTitle; }else{ track_display_mc.onEnterFrame = null; track_display_mc.display_txt._x = 0; } volume_mc._x = Stage.width - 22; start_btn_mc._xscale = Stage.width; //playlist area tinnier that the album cover if(Stage.width<2.5*cover_mc._width){ // if (Stage.height>2.5*cover_mc._height){ //send album cover to bottom cover_mc._y = Stage.height - cover_mc._height -2- info_mc._height -2; info_mc._y = Stage.height - info_mc._height -2; var covervisible =1; }else{ var covervisible =0; //hide album cover cover_mc._y = Stage.height; } //send playlist to left playlist_mc._x = cover_mc._x; scrollbar_mc.bg_mc._height = Stage.height - (19+(cover_mc._height+info_mc._height+4)*covervisible); playlist_mc.bg_mc._height = Stage.height - (19+(cover_mc._height+info_mc._height+4)*covervisible); playlist_mc.mask_mc._height = Stage.height - (23+(cover_mc._height+info_mc._height+4)*covervisible); }else{ cover_mc._y = 17; info_mc._y = 153; playlist_mc._x = 138; scrollbar_mc.bg_mc._height = Stage.height -19; playlist_mc.bg_mc._height = Stage.height - 19; playlist_mc.mask_mc._height = Stage.height - 23; } scrollbar_mc._x = Stage.width - 12; playlist_mc.mask_mc._width = Stage.width - (playlist_mc._x + 19); playlist_mc.bg_mc._width = Stage.width - (playlist_mc._x + 14); } function addTrack(track_label){ if(playlist_mc.track_count>0) { playlist_mc.tracks_mc.track_0_mc.duplicateMovieClip("track_"+playlist_mc.track_count+"_mc",playlist_mc.track_count); } playlist_mc.tracks_mc["track_"+playlist_mc.track_count+"_mc"]._y += playlist_mc.track_count*14; playlist_mc.tracks_mc["track_"+playlist_mc.track_count+"_mc"].display_txt.autoSize = "left"; playlist_mc.tracks_mc["track_"+playlist_mc.track_count+"_mc"].display_txt.text = track_label; playlist_mc.tracks_mc["track_"+playlist_mc.track_count+"_mc"].bg_mc.index = playlist_mc.track_count; playlist_mc.tracks_mc["track_"+playlist_mc.track_count+"_mc"].bg_mc.select_btn.onPress = function(){ last_track_index = track_index; playlist_mc.tracks_mc["track_"+track_index+"_mc"].bg_mc.gotoAndStop(1) track_index = this._parent.index; playlist_mc.tracks_mc["track_"+track_index+"_mc"].bg_mc.gotoAndStop(2) loadTrack(); } playlist_mc.track_count ++; } //scroll scrollbar_mc.up_btn.onPress = function(){ this._parent.v = -1; this._parent.onEnterFrame = scrollTracks; } scrollbar_mc.down_btn.onPress = function(){ this._parent.v = 1; this._parent.onEnterFrame = scrollTracks; } scrollbar_mc.up_btn.onRelease = scrollbar_mc.down_btn.onRelease = function(){ this._parent.onEnterFrame = null; } scrollbar_mc.handler_mc.drag_btn.onPress = function(){ var scroll_top_limit = 19; var scroll_bottom_limit = scrollbar_mc.bg_mc._height - scrollbar_mc.handler_mc._height - 2; this._parent.startDrag(false,this._parent._x,scroll_top_limit,this._parent._x,scroll_bottom_limit) this._parent.isdragging = true; this._parent.onEnterFrame = scrollTracks; } scrollbar_mc.handler_mc.drag_btn.onRelease = scrollbar_mc.handler_mc.drag_btn.onReleaseOutside = function(){ stopDrag() this._parent.isdragging = false; this._parent.onEnterFrame = null; } function scrollTracks(){ var scroll_top_limit = 19; var scroll_bottom_limit = scrollbar_mc.bg_mc._height - scrollbar_mc.handler_mc._height - 2; var list_bottom_limit = 1; var list_top_limit = (1-Math.round(playlist_mc.tracks_mc._height))+Math.floor(playlist_mc.mask_mc._height/14)*14 if(playlist_mc.tracks_mc._height>playlist_mc.mask_mc._height){ if(scrollbar_mc.handler_mc.isdragging){ var percent = (scrollbar_mc.handler_mc._y-scroll_top_limit)/(scroll_bottom_limit-scroll_top_limit) playlist_mc.tracks_mc._y = (list_top_limit-list_bottom_limit)*percent+list_bottom_limit; }else{ if(scrollbar_mc.v==-1){ if(playlist_mc.tracks_mc._y+14<list_bottom_limit){ playlist_mc.tracks_mc._y += 14; }else{ playlist_mc.tracks_mc._y = list_bottom_limit; } var percent = (playlist_mc.tracks_mc._y-1)/(list_top_limit-1) scrollbar_mc.handler_mc._y = percent*(scroll_bottom_limit - scroll_top_limit)+scroll_top_limit; }else if(scrollbar_mc.v==1){ if(playlist_mc.tracks_mc._y-14>list_top_limit){ playlist_mc.tracks_mc._y -= 14; }else{ playlist_mc.tracks_mc._y = list_top_limit; } var percent = (playlist_mc.tracks_mc._y-1)/(list_top_limit-1) scrollbar_mc.handler_mc._y = percent*(scroll_bottom_limit - scroll_top_limit)+scroll_top_limit; } } } } playlist_mc.onMouseWheel = function(delta){ this._parent.scrollbar_mc.v = (delta > 0) ? -1 : 1; for(i=0;i< Math.abs(delta);i++){ scrollTracks(); } } Mouse.addListener(playlist_mc); //basic keyboard navigation support playlist_mc.onKeyUp = function(delta){ var code = Key.getCode() if (code==Key.DOWN || code==Key.RIGHT) { nextTrack(); } else if (code==Key.UP || code==Key.LEFT) { prevTrack(); //todo get the status and play/pause ? //} else if (code==Key.ENTER || code==Key.SPACE) { // playTrack(); } } Key.addListener(playlist_mc); function loadPlaylist(){ track_display_mc.display_txt.text = loading_playlist_msg; if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){ track_display_mc.onEnterFrame = scrollTitle; }else{ track_display_mc.onEnterFrame = null; track_display_mc.display_txt._x = 0; } //playlist if(playlist_url){ playlist_xml.load(unescape(playlist_url)) }else{ //single track playlist_xml.parseXML(single_music_playlist) playlist_xml.onLoad(true); } } //first click - load playlist start_btn_mc.start_btn.onPress = function(){ autoplay = true; loadPlaylist(); } //main Stage.scaleMode = "noScale" Stage.align = "LT"; this.onResize = resizeUI; Stage.addListener(this); track_display_mc.display_txt.autoSize = "left"; track_display_mc.display_txt.text = player_title; if(track_display_mc.display_txt._width>track_display_mc.mask_mc._width){ track_display_mc.onEnterFrame = scrollTitle; }else{ track_display_mc.onEnterFrame = null; track_display_mc.display_txt._x = 0; } //start to play automatically if parameter autoplay is present if(autoplay){ start_btn_mc.start_btn.onPress(); } else if (autoload){ loadPlaylist() } //customized menu var my_cm:ContextMenu = new ContextMenu(); my_cm.customItems.push(new ContextMenuItem("Stop", stopTrack)); my_cm.customItems.push(new ContextMenuItem("Play!", playTrack)); my_cm.customItems.push(new ContextMenuItem("Next", nextTrack)); my_cm.customItems.push(new ContextMenuItem("Previous", prevTrack)); my_cm.customItems.push(new ContextMenuItem("Download this song", function(){getURL(playlist_array[track_index].location,"_blank")},true)); //my_cm.customItems.push(new ContextMenuItem("Add song to Webjay playlist", function(){getURL("http://webjay.org/poster?media="+escape(playlist_array[track_index].location),"_blank")})); my_cm.customItems.push(new ContextMenuItem("Learn more about this song on Jamendo", function(){getURL(playlist_array[track_index].info,"_top")})); my_cm.customItems.push(new ContextMenuItem("Find more free music on Jamendo", function(){getURL("http://www.jamendo.com/","_top")},true)); //my_cm.customItems.push(new ContextMenuItem("Crossfade", function(){})); //my_cm.customItems.push(new ContextMenuItem("Mando Diao - Paralyzed", function(){})); my_cm.hideBuiltInItems(); this.menu = my_cm; resizeUI(); \ No newline at end of file
diff --git a/modules/flash/xspf_player.fla b/modules/flash/xspf_player.fla
deleted file mode 100644
index 6e5b4e83..00000000
--- a/modules/flash/xspf_player.fla
+++ /dev/null
Binary files differ
diff --git a/modules/flash/xspf_player.swf b/modules/flash/xspf_player.swf
deleted file mode 100644
index 8198b8d3..00000000
--- a/modules/flash/xspf_player.swf
+++ /dev/null
Binary files differ