具体来说,我将在单个 html 页面上拥有 5 个 soundcloud 轨道/集。当播放其中一个时,我想更改播放器嵌入页面的背景图像,以补充播放器上的艺术作品(但不同的图像)。
有什么想法吗?
最佳答案
您应该查看 SoundCloud 提供的 Widgets API:
https://developers.soundcloud.com/docs/api/html5-widget
我想您将使用绑定(bind)函数来绑定(bind)到播放事件。像这样的东西:
widget.bind(SC.Widget.Events.PLAY , function() {
console.log('Playing... Update CSS here');
});
关于javascript - 使用 Soundcloud 播放器按钮更改嵌入的页面上的元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27062051/