fix hydra performance issues
This commit is contained in:
parent
b27f8e45dc
commit
de00212bb6
1 changed files with 5 additions and 5 deletions
|
|
@ -4,11 +4,11 @@ export async function initHydra() {
|
||||||
if (!document.getElementById('hydra-canvas')) {
|
if (!document.getElementById('hydra-canvas')) {
|
||||||
const { canvas: testCanvas } = getDrawContext();
|
const { canvas: testCanvas } = getDrawContext();
|
||||||
await import('https://unpkg.com/hydra-synth');
|
await import('https://unpkg.com/hydra-synth');
|
||||||
const hydraCanvas = testCanvas.cloneNode(true);
|
h = new Hydra({detectAudio: false });
|
||||||
hydraCanvas.id = 'hydra-canvas';
|
h.canvas.id = 'hydra-canvas';
|
||||||
testCanvas.after(hydraCanvas);
|
h.canvas.style.position = 'absolute';
|
||||||
new Hydra({ canvas: hydraCanvas, detectAudio: false });
|
h.canvas.style.top = '0px';
|
||||||
s0.init({ src: testCanvas });
|
testCanvas.after(h.canvas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue