Skip to content

Commit

Permalink
fix(canvas): fix the path and id
Browse files Browse the repository at this point in the history
  • Loading branch information
eepson123tw committed Oct 3, 2024
1 parent a53853d commit 01c5e6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fet-trick/canvas/canvas-lyrics-player.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<canvas id="lyrics-canvas"></canvas>
</div>

<audio src="../public/02.mp3" controls type="audio/ogg"></audio>
<audio src="../public/02.mp3" controls type="audio/ogg" id="audio-player"></audio>
<script>
const lyrics = [
{ time: 0, text: "(傷心酒店 city pop)" },
Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ async function processHtmlFiles(targetDir: string, contentDir: string) {
let content = await fs.promises.readFile(file, "utf-8");

content = content.replace(
/<audio src="\.\.\/public\/([^"]+)" controls type="audio\/ogg"><\/audio>/g,
'<audio src="./$1" type="audio/ogg" controls></audio>'
/<audio src="\.\.\/public\/([^"]+)" controls type="audio\/ogg" id="audio-player"><\/audio>/g,
'<audio src="./$1" type="audio/ogg" controls id="audio-player"></audio>'
);
// Update <source> paths
content = content.replace(
Expand Down

0 comments on commit 01c5e6e

Please sign in to comment.