Skip to content

Instantly share code, notes, and snippets.

@hustKiwi
Last active December 11, 2015 01:49
Show Gist options
  • Save hustKiwi/4525920 to your computer and use it in GitHub Desktop.
Save hustKiwi/4525920 to your computer and use it in GitHub Desktop.
_.utils.api('baidu.ting.song.play', {
songid: sid
}, {
expires: 0
}).done(function(r) {
self._curSong = r;
self.setUrl(r.bitrate.file_link);
self.trigger('player:fetch', r);
}).fail(function(r) {
// TODO: server返回错误,之后要记录日志或重试
console.error('player fetch error: ', sid, r.error_code);
self.trigger('error', r);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment