Embedded MP3 player

Soldato
Joined
18 Oct 2002
Posts
18,296
Location
Brighton
I'm designing a website for a friend of mine and he wants to put some of his audio on the site with an audio player, i tried to hotlink the myspace one but it didn't last long before it stopped working and i can't seem to find anything which is anywhere near as good, or free.

Does anyone have any suggestions?
 
I've got that one working but i don't want the slim version, trouble is i can't seem to see the non-slim version on that site anywhere!!!
 
Oh, i've managed to get hold of the fullsize .swf for the xspf player, it works VERY well, thanks :D
 
Thats the slim version still, all i did was link to the player on their site and right click > save target as :)
 
well i've got the player now, but i have a question... if i use this on my site will visitors be able to download the mp3's somehow, or is the ONLY way to listen to them the embedded player?

i really don't want people to have any way to steal my music!
 
seek said:
well i've got the player now, but i have a question... if i use this on my site will visitors be able to download the mp3's somehow, or is the ONLY way to listen to them the embedded player?

i really don't want people to have any way to steal my music!

Well in theory if the person really wants to get your MP3s they can. All you would need to do is download and open the xspf file which tells you where the files actually are. Also if they really wanted to they could just record the stream through their computer using some audio software.
 
how the hell do you disable auto play???

in "xspf_player.as" i changed
Code:
//autoplay=true
to
Code:
//autoplay=false

but it still starts playing when ever the page is loaded. :confused:
 
Isn't it the url thats parsed to the player, does it have an &autplay bit in it or something along those lines?
 
As you can see, all instances of "autoplay=true" have been changed to false, but it still starts to play when the page loads. :o


Code:
/*
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.
*/
stop();
//autoplay=false
//repeat_playlist = true;in "[b]xspf_player.as[/b]"
//playlist_size = 3;
//player_title = "customizeable title test"
//song_url = "http://downloads.betterpropaganda.com/music/Imperial_Teen-Ivanka_128.mp3";
//playlist_url = "http://cchits.ning.com/recent/xspf/?xn_auth=no";
//playlist_url = "http://hideout.com.br/shows/radio-test.xspf";
//radio_mode = true;
//song_title = "Imperial Teen - Ivanka";
autoload=true;
//info_button_text = "Add to Cart"
//playlist_url = "http%3A%2F%2Fwebjay%2Eorg%2Fby%2Flucas%5Fgonze%2Flaconic%2Exspf"
//playlist_url= "http://hideout.com.br/tests/hideout2325.xspf"
//constants
DEFAULT_PLAYLIST_URL = "http://hideout.com.br/shows/allshows.xspf";
DEFAULT_WELCOME_MSG = "Hideout XSPF Music Player - by Fabricio Zuardi";
LOADING_PLAYLIST_MSG = "Loading Playlist...";
DEFAULT_LOADED_PLAYLIST_MSG = "- click to start"
DEFAULT_INFOBUTTON_TXT = "Info"
//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;
if(!info_button_text){
	info_button_text = DEFAULT_INFOBUTTON_TXT;
}
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(autoplay){
			loadTrack()
		}else{
			start_btn_mc.start_btn.onPress = loadTrack;
			track_display_mc.display_txt.text = playlist_title+" "+DEFAULT_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;
}

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=false;
		autoplay=false;
		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;
	}
	cover_mc.content_mc["photo"+last_track_index].removeMovieClip();
	mysound.loadSound(playlist_array[track_index].location,true);
	play_mc.gotoAndStop(2)

	//image from playlist
	if(playlist_array[track_index].image!=undefined){
		cover_mc.content_mc.createEmptyMovieClip("photo"+track_index,track_index)
		cover_mc.content_mc["photo"+track_index].loadMovie(playlist_array[track_index].image)
	}else{
	}
	//info button
	if(playlist_array[track_index].info!=undefined){
		info_mc._visible = true;
		info_mc.info_btn.onPress = function(){
			getURL(playlist_array[track_index].info,"_blank")
		}
	}else{
		info_mc._visible = false;
	}
	_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;
		var image_load_percent = (cover_mc.content_mc["photo"+track_index].getBytesLoaded()/cover_mc.content_mc["photo"+track_index].getBytesTotal())*100
		cover_mc.load_bar_mc._xscale = image_load_percent;
		if((cover_mc.content_mc["photo"+track_index].getBytesLoaded()>4)&&(image_load_percent==100)){
			//image loaded
			//make image fit
			cover_mc.content_mc["photo"+track_index]._width = cover_mc.load_bar_mc._width
			cover_mc.content_mc["photo"+track_index]._height = cover_mc.load_bar_mc._height
		}
	}
}

stop_btn.onRelease = st
 
Back
Top Bottom