javascript - 使用 Soundcloud 播放器按钮更改嵌入的页面上的元素

标签 javascript html soundcloud

具体来说,我将在单个 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/

相关文章:

soundcloud - 事件不触发 html5 播放器

javascript - 如何强制同步 soundcloud javascript sdk 调用?

javascript - 对 Array.prototype.some 使用额外的回调参数

javascript - 为什么 GWT 编译需要用户代理规范?

html - 将图像在 div 中居中对齐

html - 将背景图像设置为输入类型 ="file"基础 css 的按钮

javascript - 是否存在 window.unload 事件不会触发的条件?

javascript - 合并两个数组,使第一个索引都在新数组中,依此类推

css - 让表格在 td 中填充 100% 高度

api - SoundCloud API v3 Stream 在 Chrome 中不起作用