简体   繁体   English

无法流式传输SoundCloud的某些曲目

[英]Can't stream some of SoundCloud's tracks

I'm having issues streaming a small number of tracks from SoundCloud. 我在从SoundCloud传输少量曲目时遇到问题。

I am using AVPlayer/AVPlayerItem to stream the SoundCloud tracks, which has worked perfectly with most of SoundCloud's tracks, but recently some of the newer SoundCloud tracks won't play. 我正在使用AVPlayer / AVPlayerItem来流处理SoundCloud轨道,该轨道与大多数SoundCloud的轨道完美配合,但是最近一些较新的SoundCloud轨道将无法播放。 I've tried listening to all the AVPlayerItem notifications, and none of them report an error. 我尝试收听所有AVPlayerItem通知,但没有一个报告错误。

I've also tried using MPMoviePlayerViewController and MPMoviePlayerController to stream these tracks. 我也尝试过使用MPMoviePlayerViewController和MPMoviePlayerController来流式播放这些曲目。 They can play the other tracks just fine, but also are unable to play these select few. 他们可以播放其他曲目,但不能播放这些精选曲目。

I've even tried playing them in my computer's browser. 我什至尝试在计算机的浏览器中播放它们。 With the working tracks, I get an in-browser audio player, and the track starts streaming. 使用工作轨道,我得到了一个浏览器内音频播放器,轨道开始流式传输。 When I try the problematic tracks, nothing happens - no in-browser audio player, and no audio streaming of any kind. 当我尝试有问题​​的曲目时,什么也没发生-没有浏览器内音频播放器,也没有任何音频流。 When I go to view source, I also see nothing. 当我查看源代码时,也看不到任何内容。

My initial assumption was that these streams are empty, or somehow not working, but when I try playing the same tracks through SoundCloud's iOS app, they play just fine. 我最初的假设是这些流是空的,或者某种程度上不起作用,但是当我尝试通过SoundCloud的iOS应用播放相同的音轨时,它们的播放效果很好。 This suggests there's a way to get this working, but they might have access to streaming url's that work better and are not distributed through the public API. 这表明有一种方法可以使此工作正常进行,但是他们可能可以访问效果更好的流URL,并且不通过公共API进行分发。

Here's an example of a track that won't work in my app: http://soundcloud.com/cyrilhahn/cyril-hahn-javeon-breaking 这是一个无法在我的应用程序中运行的曲目的示例: http : //soundcloud.com/cyrilhahn/cyril-hahn-javeon-breaking

Here's the api call to that track: http://api.soundcloud.com/tracks/132839787?client_id=YOUR_CLIENT_ID 这是该轨道的api调用: http : //api.soundcloud.com/tracks/132839787?client_id=YOUR_CLIENT_ID

(Apologies for any inconvenience, but you'll need to fill in YOUR_CLIENT_ID with a valid SoundCloud api client id, I can't provide mine.) (对于给您带来的任何不便,我们深表歉意,但是您需要使用有效的SoundCloud api客户端ID填写YOUR_CLIENT_ID,我无法提供。)

Which includes a 'stream-url' key with the following url to stream the track (sorry, I had to abbreviate the following link because I can only post 2 links, due to having 0 reputation): ...com/tracks/132839787/stream?client_id=YOUR_CLIENT_ID 其中包括带有以下URL的“ stream-url”键以流式播放曲目(对不起,我不得不缩写以下链接,因为由于具有0信誉,所以我只能发布2个链接):... com / tracks / 132839787 /流?CLIENT_ID = YOUR_CLIENT_ID

The API call to the track even includes a 'streamable' key, which is saying 'true'. 对该曲目的API调用甚至包括“ streamable”键,即“ true”。

Because the native iOS classes I've tried using to stream this aren't reporting any errors, I'm really not sure what to go by. 因为我尝试用于流式处理的本机iOS类没有报告任何错误,所以我真的不确定该怎么做。 The only thing someone mentioned to me was that those tracks might be RTMP streams, which iOS doesn't support. 有人向我提到的唯一一件事是,这些曲目可能是RTMP流,iOS不支持。

Here's another stackoverflow post which has a similar and possibly relevant question, but no responses yet: SoundCloud track.stream_url not working for some of the tracks 这是另一个stackoverflow帖子,它具有类似且可能相关的问题,但尚未答复: SoundCloud track.stream_url对于某些曲目不起作用

As you suggested, the reason the stream url doesn't for all tracks is because some tracks exclusively use (RTMP/HLS) for streaming. 正如您所建议的,之所以没有为所有轨道提供流URL是因为某些轨道专门使用(RTMP / HLS)进行流传输。

SoundCloud's in the progress of updating the SDKs and documentation for this, but this means that the Cocoa SDK isn't updated yet. SoundCloud正在为此更新SDK和文档,但是这意味着Cocoa SDK尚未更新。 I'm not sure if there's any API changes planned to reflect the streaming type, but I've mentioned the issue in the team. 我不确定是否计划进行任何API更改以反映流类型,但是我已经在团队中提到了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM