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

Using Soundcloud player buttons to change elements on the page embedded on

本文关键字:元素 播放器 Soundcloud 按钮 使用      更新时间:2023-09-26

具体来说,我将在一个html页面上有5个soundcloud轨道/集。当播放其中一个时,我想更改嵌入播放器的页面的背景图像,以补充播放器上的艺术品(但图像不同)。

有什么想法吗?

您应该查看SoundCloud提供的Widgets API:

https://developers.soundcloud.com/docs/api/html5-widget

我想您将使用绑定函数绑定到播放事件。像这样:

 widget.bind(SC.Widget.Events.PLAY , function() {
     console.log('Playing... Update CSS here');
 });