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 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么