mirror of
https://github.com/Spengreb/sync.git
synced 2026-05-14 03:32:06 +00:00
soundcloud: fix volume preservation
Soundcloud requires rebinding the READY event when a new track is loaded in order to set the volume.
This commit is contained in:
parent
319c52911a
commit
efdab32aa8
2 changed files with 9 additions and 1 deletions
|
|
@ -69,6 +69,9 @@ window.SoundCloudPlayer = class SoundCloudPlayer extends Player
|
||||||
else
|
else
|
||||||
soundUrl = data.id
|
soundUrl = data.id
|
||||||
@soundcloud.load(soundUrl, auto_play: true)
|
@soundcloud.load(soundUrl, auto_play: true)
|
||||||
|
@soundcloud.bind(SC.Widget.Events.READY, =>
|
||||||
|
@setVolume(VOLUME)
|
||||||
|
)
|
||||||
else
|
else
|
||||||
console.error('SoundCloudPlayer::load() called but soundcloud is not ready')
|
console.error('SoundCloudPlayer::load() called but soundcloud is not ready')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -771,9 +771,14 @@
|
||||||
} else {
|
} else {
|
||||||
soundUrl = data.id;
|
soundUrl = data.id;
|
||||||
}
|
}
|
||||||
return this.soundcloud.load(soundUrl, {
|
this.soundcloud.load(soundUrl, {
|
||||||
auto_play: true
|
auto_play: true
|
||||||
});
|
});
|
||||||
|
return this.soundcloud.bind(SC.Widget.Events.READY, (function(_this) {
|
||||||
|
return function() {
|
||||||
|
return _this.setVolume(VOLUME);
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
} else {
|
} else {
|
||||||
return console.error('SoundCloudPlayer::load() called but soundcloud is not ready');
|
return console.error('SoundCloudPlayer::load() called but soundcloud is not ready');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue