Skip to content

Commit

Permalink
fix: playMusic wasn't working on static context due cors
Browse files Browse the repository at this point in the history
  • Loading branch information
lajbel committed Nov 1, 2024
1 parent b1a4c4b commit 2df8193
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/audio/playMusic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { AudioPlay, AudioPlayOpt } from "./play";
export function playMusic(url: string, opt: AudioPlayOpt = {}): AudioPlay {
const onEndEvents = new KEvent();
const el = new Audio(url);
el.crossOrigin = "anonymous";
const src = _k.audio.ctx.createMediaElementSource(el);

src.connect(_k.audio.masterNode);
Expand Down

0 comments on commit 2df8193

Please sign in to comment.