dousu1916 2012-07-22 00:02
浏览 31
已采纳

用于采样和销售歌曲的PHP / JavaScript MP3播放器[关闭]

I used jPlayer to make a custom MP3 player for a buddy of mine's site, but now he want to be able to hide the links (you can see them in JavaScript) and make the songs available for download only through Paypal purchase. In other words, he wants to keep the player on his site as is, but to make any download of his songs purchase only. I'm at a complete loss on where to start in such a venture. Can anyone gimmie some direction?

Just to clarify, I know I cant "hide the script", but I was hoping someone might know a way to get jPlayer to read from a server (php return) or an alternative player thats just as easy to style. I think I can set the paypal links up pretty easy, but not sure waht to do to keep m3's from being found in javascript without racking my brain (not getting paid) to find a server-side solution.

I'm not being paid, so I'm trying to find a quick, easy, free solution.

  • 写回答

1条回答 默认 最新

  • dq_1984 2012-07-22 00:20
    关注

    You really aren't going to be able to truly hide anything in JavaScript, certainly not from anyone who knows to turn on the Network tab of Firebug or IE9's developer tools. You're probably going to need some help from your server to make downloading from the preview player less feasible.

    The simplest option is not to provide the to-be-purchased tracks through the web player at all. Many sites successfully offer only 30-sec samples or do something like add a periodic tone to the track. The download mp3 files can only be accessed with a validation code from the purchase. A PHP script would confirm the code, read the MP3 from a folder outside the web root and pass it along to the browser (with the correct Content-type and file disposition headers).

    If it's absolutely mission-critical to provide the unaltered audio without allowing it to be downloaded, jPlayer does seem to have some support for streaming mp3... google a bit for streaming mp3 server and see if anything available there is available to you on your server.

    Either way, you'll keep the to-be-purchased MP3s out of the wwwroot/htdocs folder and serve them up when the purchase is confirmed.

    Edit:

    There are free/open-source streaming mp3 servers, but I don't know whether your host is flexible enough to let you install one. The advantage of streaming the mp3 to jPlayer is that jPlayer isn't actually downloading the mp3... you reserve that for the paying fans! Google offered up these links you might find useful (haven't tried myself):

    http://www.icecast.org/

    http://www.vibestreamer.com/

    http://www.yolinux.com/TUTORIALS/LinuxTutorialAudioStreaming.html

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥30 酬劳2w元求合作写文章
  • ¥15 在现有系统基础上增加功能
  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码