0

我正在开发一个 Spotify 应用程序,我希望用户能够单击曲目名称并链接到曲目页面,就像在其他 Spotify 应用程序中一样。不过,我想阻止歌曲开始播放。

SoundDrop 似乎可以做到这一点。您可以单击曲目名称,歌曲不会中断 SoundDrop 的播放。

我不确定如何实现这种替代行为。有任何想法吗?

4

1 回答 1

0

The Apps API uses standard JavaScript stuff, so if you attach a handler to the track link and use e.preventDefault(), that should prevent Spotify playing the track and you can then do your own custom handling.

More discussion on e.preventDefault() is here: event.preventDefault() vs. return false

于 2012-05-08T08:23:34.670 回答