如何检查录制的曲目是否已上传并激活以进行嵌入。
上传完成后,我想显示轨道的嵌入预览。
但我在解析 url 时从 scPlayer api 收到 404 错误。
可以跟踪轨道的可用性,基于我可以使用 sCPlayer()
用于解决轨道。
有什么帮助吗?
谢谢彼得
如何检查录制的曲目是否已上传并激活以进行嵌入。
上传完成后,我想显示轨道的嵌入预览。
但我在解析 url 时从 scPlayer api 收到 404 错误。
可以跟踪轨道的可用性,基于我可以使用 sCPlayer()
用于解决轨道。
有什么帮助吗?
谢谢彼得
I know in the /tracks
resource there is a attribute called state
which could be what you're looking for.
On their docs, the example value they give is finished
, so maybe it would read uploading
or processing
before the track is ready. NB: I haven't tried this myself.
{
"id": 13158665,
"created_at": "2011/04/06 15:37:43 +0000",
"user_id": 3699101,
"duration": 18109,
"commentable": true,
"state": "finished",
"sharing": "public",
"tag_list": "soundcloud:source=iphone-record",
"permalink": "munching-at-tiannas-house",
"description": null,
"streamable": true,
"downloadable": true,
"genre": null,
"release": null,
"purchase_url": null,
"label_id": null,
"label_name": null,
"isrc": null,
"video_url": null,
"track_type": "recording",
"key_signature": null,
"bpm": null,
"title": "Munching at Tiannas house",
"release_year": null,
"release_month": null,
"release_day": null,
"original_format": "m4a",
"original_content_size": 10211857,
"license": "all-rights-reserved",
"uri": "http://api.soundcloud.com/tracks/13158665",
"permalink_url": "http://soundcloud.com/user2835985/munching-at-tiannas-house",
"artwork_url": null,
"waveform_url": "http://w1.sndcdn.com/fxguEjG4ax6B_m.png",
"user": {
"id": 3699101,
"permalink": "user2835985",
"username": "user2835985",
"uri": "http://api.soundcloud.com/users/3699101",
"permalink_url": "http://soundcloud.com/user2835985",
"avatar_url": "http://a1.sndcdn.com/images/default_avatar_large.png?142a848"
},
"stream_url": "http://api.soundcloud.com/tracks/13158665/stream",
"download_url": "http://api.soundcloud.com/tracks/13158665/download",
"playback_count": 0,
"download_count": 0,
"favoritings_count": 0,
"comment_count": 0,
"created_with": {
"id": 124,
"name": "SoundCloud iPhone",
"uri": "http://api.soundcloud.com/apps/124",
"permalink_url": "http://soundcloud.com/apps/iphone"
},
"attachments_uri": "http://api.soundcloud.com/tracks/13158665/attachments"
}
from: http://developers.soundcloud.com/docs/api/tracks
alternatively, there could be another value, like duration
or stream_url
that will read NULL until the track is ready.