Set a background on wavesurfer and clear it.
Hopefully fixes ghost waveforms and scroll bars
This commit is contained in:
parent
0e56146ad7
commit
78c6b80915
2 changed files with 9 additions and 0 deletions
|
@ -97,6 +97,7 @@ class Player extends ((PlayerEmitter as unknown) as { new (): EventEmitter }) {
|
|||
audioContext: engine.audioContext,
|
||||
container: "#waveform-" + player.toString(),
|
||||
waveColor: "#CCCCFF",
|
||||
backgroundColor: "#FFFFFF",
|
||||
progressColor: "#9999FF",
|
||||
backend: "MediaElementWebAudio",
|
||||
barWidth: 2,
|
||||
|
|
|
@ -294,6 +294,14 @@ export const load = (
|
|||
|
||||
console.log("loading");
|
||||
|
||||
let waveform = document.getElementById("waveform-" + player.toString());
|
||||
if (waveform == null) {
|
||||
throw new Error();
|
||||
}
|
||||
waveform.innerHTML = ""; // clear previous (ghost) wavesurfer
|
||||
// wavesurfer also sets the background white, remove for progress bar to work.
|
||||
waveform.style.removeProperty("background");
|
||||
|
||||
try {
|
||||
const signal = loadAbortControllers[player].signal; // hang on to the signal, even if its controller gets replaced
|
||||
const result = await fetch(url, {
|
||||
|
|
Loading…
Reference in a new issue