Yahoo! Media Player

YMP gets its playlist from links in the web page in which it is contained. Sometimes this is inconvenient for the publisher, who wants to make music available for streaming but not downloading. How can a publisher conceal direct links in order to make it harder for users to download?

One strategy is to keep the link out of the visible web page only. A user who wants to view source can still find the download link. Ways to do this include: No content in your anchor: <a href="example.mp3"></a> Hiding your anchor with CSS: <a href="example.mp3" style="display:none"></a>

Another strategy is to put the link in an external playlist. A user who wants to view source, grab the playlist URL, fetch the playlist, and look inside the playlist can still find the download link. Ways to do this include: Use an XSPF playlist: <a href="example.xspf">my playlist</a> Put your link in an external web page and scrape it with the "playthispage" keyword: <a href="example.html" class="playthispage">my playlist</a>

Another idea related to hiding links would be to leave all the media file links out of the markup, then write them into the DOM via JavaScript. If you execute this script before page load completes, the links will be visible to the player when it does its parse, but will not be visible to users who view the source of the document. The links will, of course, still be visible to power users who utilize something like Firebug to view the DOM, but it should effectively obfuscate the links from average users. Another strategy is to expire URLs, so that the media URL in the web page can only be used once or can only be used for a short time. This goes in the direction of the world of encryption and more aggressive security, which is out of scope for this article.


A few notes about adding the player to Wordpress Blogs (I have mine hosted by Yahoo!): This works as-is but I don't like the fact that I can see the link location.

<script type="text/javascript" src=""></script>   
      <a href="" title="song01">Track 01</a><br>   
      <a href="" title="song02">Track 02</a><br>   
      <a href="" title="song03">Track 03</a><br>   
      <a href="" title="song04">Track 04</a><br>   
      <a href="" title="song05">Track 05</a><br>

So I made a playlist.xspf file for my music. This works, but the link text tries to pop up the .xspf file and that's not good. The users will always try to click on the text link first.

<a href=”FLASH]||1&songID=0&autoplay=false&wmode=transparent[/FLASH]″>First link</a> <a href=”″>Second link</a> <a href=”″>Third link</a>

This works better because I put the text *after* the link, but the play button is tiny. The text s say "click the play button" or something. And no links are shown. Yay!

<<script type=”text/javascript” src=””></script>>   
       <B>Click here to play!</B>

This link improves on the previous one by placing the heading tags between the playlist link so the text that comes afterwards is more prominent on the page.

<script type="text/javascript" src=""></script>   
      <h2><a href="" type="application/xspf+xml"></a> Play!</h2>

And finally, can someone give me more 'play' button options? The little button tends to get lost on some of my more elaborate pages.

Rene Ferrer Aug 27, 2008 "Hiding Links" can be mean "preventing visitors from clicking the link text". My site had an issue with song titles as link text that were underlined and blue like the usual hyperlinks. When visitors click the link text instead of the little play button they were taken to a blank page. Bad news. But it happens since the href attribute is "name.mp3". Two things were done to correct the issue: the link was restyled (CSS recolored and removed underlines) and a javascript event was added: onclick='return false;'. This solved my "the name of this audio clip looks like a hyperlink so I will click it" problem. And lastly this has nothing to do with the putative "hiding links" issue above.

Hugh Poynor Oct 16 2008.</p>


i find an other way to hiding links, very simple (but not simple for me to describe, cos' i'm french speaker in général)it works, and let showing the play button where you place your playlist in your page (if you can embedded it, of course): it is to place your cursor at the beginning of the link in html view, or at the end, nevermind, create a little space with "tab" and go back to the end of link -select and cut, save your work, it's all folks. Ok, the link is always here and can be find, but does not appears! Actually i find how make the link disappear completely with this amelioration: you have to push the space you create just at the end of the line with the closing anchor "</a>" Maybe you can améliorate my défectious explication if you test it

== I successfully hid my music file links everywhere except in the playlist pop out drawer on top of the player. Has anyone tried to disable the links here? I would appreciate any help or advice you can give.

--unknown person

You could hide the drawer using CSS. So use Firebug to look up the CSS selector for the drawer, then in your CSS do display:none on that selector.

--Lucas gonze 18:16, 2 July 2009 (UTC)

I found this useful and very simple:

All you do is add this to the body of an HTML page:

<body oncontextmenu="return false;">

For additonal info see: