Yahoo! Media Player
Register
Advertisement

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="http://mediaplayer.yahoo.com/js"></script>   
      <a href="http://www.mywebsite.com/music/albumdir/song01-final.mp3" title="song01">Track 01</a><br>   
      <a href="http://www.mywebsite.com/music/albumdir/song02-final.mp3" title="song02">Track 02</a><br>   
      <a href="http://www.mywebsite.com/music/albumdir/song03-final.mp3" title="song03">Track 03</a><br>   
      <a href="http://www.mywebsite.com/music/albumdir/song04-final.mp3" title="song04">Track 04</a><br>   
      <a href="http://www.mywebsite.com/music/albumdir/song05-final.mp3" 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]http://static.mp3.zing.vn/skins/gentle/flash/mp3playlist.swf?xmlURL=http://mp3.zing.vn/play/?pid=IWZBW6U8||1&songID=0&autoplay=false&wmode=transparent[/FLASH]″>First link</a> <a href=”http://mp3.zing.vn/mp3/nghe-album/Anh-Khong-Muon-Bat-Cong-Voi-Em-2-H-A-T-Ung-Hoang-Phuc-T.120264.4.html″>Second link</a> <a href=”http://zing.mp3.vn.com/example3.mp3″>Third link</a>


This works better because I put the text *after* the link, but the play button is tiny. The text shttp://www.hugle.net/nhng-yahoo-media-player-vo-web-blog-vi-3-bc-gin/hould say "click the play button" or something. And no links are shown. Yay!


<<script type=”text/javascript” src=”http://mediaplayer.yahoo.com/js”></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="http://mediaplayer.yahoo.com/js"></script>   
      <h2><a href="http://www.mywebsite.com/music/albumdir/playlist.xspf" 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:

http://javascript.about.com/library/blnoright.htm

JeffInPoulsbo

02/18/2011

Advertisement