且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用Soundcloud api将流导入html5音频播放器?

更新时间:2023-01-07 16:41:31

好,知道了.问题是.stream()-它是要交付由.play()函数部署的预打包播放器.

Ok, got it figured out. The problem was the .stream() - it's meant to deliver a prepackaged player, deployed by the .play() function.

如果改用SC.get(),则实际上将访问轨道的属性,并将其嵌入音频标签中.查看我的代码: http://jsfiddle.net/LpzpK/6/

If you use SC.get() instead, you'll actually access the properties of the track, and be able to embed it in an audio tag. See my code: http://jsfiddle.net/LpzpK/6/

仍然存在问题-曲目被标记为401禁止,因此播放器只能加载".您必须找到一种方法来公开要播放的曲目.

There's still a problem - the tracks are marked as 401 forbidden, so the player is only ever "Loading". You'll have to find a way to make the tracks you want to play public.