Killersites.com Homepage Welcome Guest   |   Register  |  Login
Login Name Password
  Search  
  Index  | Recent Threads  | Unanswered Threads  | Who's Online  | User List  | Help


Quick Go »

No member browsing this thread
Thread Status: Active
Total posts in this thread: 19
Posts: 19   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 21169 times and has 18 replies Next Thread
Male JWB
Stranger




Joined: Dec 23, 2005
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
Adding "clickable" individual .mp3 files to page?

Hi... using Frontpage 2003.

I'm working on a music website that isn't on a server yet. On one of the pages, I'd like to add individual links to .mp3 files (songs of mine) that will be located on the server. They'll be about 4mb each so streaming may be needed. Any suggestions?

Also, any methods for protecting their download?

Thanks,
Jon

[Dec 23, 2005 10:15:10 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male revrandysausage
Advanced Member
Member's Avatar

USA
Joined: Oct 13, 2005
Post Count: 179
Status: Offline
Reply to this Post  Reply with Quote 
Re: Adding "clickable" individual .mp3 files to page?

Here is one solution ... don't use frontpage. biggrin

If you just put a link to the file you will end up with the user downloading it.

Here is a link to a page that deals with linking to .mov and mp3s:

streaming mp3s

This will require a bit of java script and there may be other ways. I am not sure because I've never tried it.

Here is another tutorial from a different site. I am at work (though eating my lunch at the moment so I really didn't have time to read through this one - sorry.

Good luck!

Randy
----------------------------------------
I made a 0 into a 1!!!!!
----------------------------------------
[Edit 1 times, last edit by revrandysausage at Dec 23, 2005 11:13:54 AM]
[Dec 23, 2005 11:10:33 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Male JWB
Stranger




Joined: Dec 23, 2005
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
Re: Adding "clickable" individual .mp3 files to page?

Hey Randy, thanks for the tip and links! smile

I'm going to look into this right now.

Jon
[Dec 23, 2005 11:26:32 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male billyboy
Advanced Member
Member's Avatar


Joined: Sep 3, 2005
Post Count: 2206
Status: Offline
Reply to this Post  Reply with Quote 
Re: Adding "clickable" individual .mp3 files to page?

The following code pasted into the head of the page will embed media player. Width and height are set to 0 so it is hidden.

<script type="text/javascript">
function play(media){
document.getElementById('mediaplayer').innerHTML='<object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"'
+'type="application/x-oleobject" width="0" height="0"><param name="fileName" value="'+media+'">'
+'<embed type="application/x-mplayer2" src="'+media+'" width="0" height="0"><\/embed><\/object>'
}
</script>

Then in the body add links for each music source and add some styles with CSS. (Writing a fake url with a legitimate file extension for media player will serve as a stop funtion). Add an empty div at the bottom of your page with the id matching the javascript getElementById to serve as refrence for the javascript code.

<ul>
<li><a onclick="play(this.href);return false" href="SOURCE 1">1</a></li>
<li><a onclick="play(this.href);return false" href="SOURCE 2">2</a></li>
<li><a onclick="play(this.href);return false" href="SOURCE 3">3</a></li>
<li><a onclick="play(this.href);return false" href="stop.m3u">X</a></li>
</ul>

<div id="mediaplayer"></div>

To stream mp3s, create a file in your html editor, insert the url where your mp3 file is stored (for example: http://www.yoursite.com/sound/music.mp3) and save this file with an .m3u extension (somename.m3u) Repeat for each mp3 giving each a unique name. Upload these files to the directory where your mp3s are stored. Insert the URL for these files (not the mp3s) into your links.

As for preventing people downloading them, there is no surefire way. Your best bet is to use low quality samples that will entice people to want to hear more and buy the CD rather than using the full length high quality version.
----------------------------------------
Quiquid latine dictum sit altum viditur
[Dec 23, 2005 3:28:58 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male JWB
Stranger




Joined: Dec 23, 2005
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
Re: Adding "clickable" individual .mp3 files to page?

Wow!.. Thanks for your time and effort here billyboy. I really appreciate it! I'll let you know how it turns out.

Jon
[Dec 23, 2005 3:54:40 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male JWB
Stranger




Joined: Dec 23, 2005
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
Re: Adding "clickable" individual .mp3 files to page?

Fantastic... thank you very much! Works like a charm!

One question: When moving objects and text from left to right, is it common to have a lot of "&nbsp;" in the code? I'm hitting the tab key and I'm seeing a lot of these. sad

Thanks again,
Jon
[Dec 23, 2005 6:25:11 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male billyboy
Advanced Member
Member's Avatar


Joined: Sep 3, 2005
Post Count: 2206
Status: Offline
Reply to this Post  Reply with Quote 
Re: Adding "clickable" individual .mp3 files to page?

Hi Jon,

Glad to hear the worked for you.
&nbsp; is the html code for non-breaking line space. If you're using tab to move an element to the left you will certainly get a lot of them. It's an ugly way of positioning elements. You'd be better off setting the left margin of whatever it is you're trying to position using CSS.

Bill
----------------------------------------
Quiquid latine dictum sit altum viditur
[Dec 24, 2005 10:23:46 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male shelfimage
Advanced Member
Member's Avatar

USA
Joined: Mar 24, 2005
Post Count: 3000
Status: Offline
Reply to this Post  Reply with Quote 
Re: Adding "clickable" individual .mp3 files to page?

Great Post!!! One for the Bookmarks. Thanks.

Re: FP2003 - it's ok to use in its Text Editor environment for hand coding. Using it as a wysiwyg editor will add those &nbsp; and other bloated code that makes the code unclean.

-
----------------------------------------
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo
Save the developers<!>
Maine Webworks
[Dec 24, 2005 10:48:32 AM] Show Printable Version of Post    View Member Profile    Send Private Message    mainewebworks    mainewebworks [Link] Report threatening or abusive post: please login first  Go to top 
Male billyboy
Advanced Member
Member's Avatar


Joined: Sep 3, 2005
Post Count: 2206
Status: Offline
Reply to this Post  Reply with Quote 
Re: Adding "clickable" individual .mp3 files to page?

I haven't tried this, but theoretically it should be possible to use that for any sort of player. The class id (clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95) and mime type (application/x-mplayer2) in that code refer to media player. You should be able to change those to match the correct class id and mime type for something different. A search would turn up what different players use.

If you were using it to show videos or flash presentations you'd want to insert the code minus all the extra characters for javascript into the div and add height and width, and also add the same height and width to the javascript. What's happening is the javascript is writing the code into the div when you click on one of the links. Without the player there to begin with it would appear out of nowhere and cause display problems on your page.
<div id="mediaplayer">
<object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
type="application/x-oleobject" width="300" height="300"><param name="fileName" value="">
<embed type="application/x-mplayer2" src="" width="300" height="300"></embed></object>
</div>
You may also want to add some param name tags to object and properties to embed. Since none are defined they're all default. The original code had all that but it's not needed in this case, it's the bare bones minimum needed to play music.

Edit:
Doh!! All you have to is define the width and height of the div with CSS to match the values used in the javascript. It will work for flash, here's the code from a test page with the correct class id and mime type.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html charset=iso-8859-1">
<title>Untitled</title>
<style type="text/css">
#player {
width: 400px;
height: 300px;
margin: 0;
padding: 0;
background: #ccc;
}
</style>
<script type="text/javascript">
function play(media){
document.getElementById('player').innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
+'width="400" height="300"><param name="movie" value="'+media+'">'
+'<embed src="'+media+'" width="400" height="300" type="application/x-shockwave-flash"><\/embed><\/object>'
}
</script>
</head>
<body>
<ul>
<li><a onclick="play(this.href);return false" href="sisters.swf">1</a></li>
<li><a onclick="play(this.href);return false" href="stop.swf">X</a></li>
</ul>
<div id="player"></div>
</body>
</html>

----------------------------------------
Quiquid latine dictum sit altum viditur
----------------------------------------
[Edit 3 times, last edit by billyboy at Dec 24, 2005 2:20:52 PM]
[Dec 24, 2005 12:03:35 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male JWB
Stranger




Joined: Dec 23, 2005
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
Re: Adding "clickable" individual .mp3 files to page?

You'd be better off setting the left margin of whatever it is you're trying to position using CSS.

Bill



Ok then thanks... so far so good. I've inserted this CSS code:

<head>
<style type="text/css">p.leftmargin {margin-left: 13cm}
</style>
</head>

<p class="leftmargin"><font size="7" face="Sylfaen">Music</font></p>

Now, if I want to add text slightly below "Music" that's centered and of a smaller font, how would I do that?

Jon
[Dec 24, 2005 5:48:37 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 19   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread