From 6d9bf2cbabd3bf9b492e2d35b26719819dd3ba1e Mon Sep 17 00:00:00 2001 From: Jakub Hejhal Date: Fri, 5 Jul 2024 12:33:11 +0200 Subject: [PATCH 1/4] include audio assets in the webpack build --- src/build_logic/webpack.common.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/build_logic/webpack.common.js b/src/build_logic/webpack.common.js index 98201f19..259e09c8 100644 --- a/src/build_logic/webpack.common.js +++ b/src/build_logic/webpack.common.js @@ -48,7 +48,12 @@ const common = { { from: path.resolve(__dirname, '../../_prebuild_output/assets'), to: path.resolve(__dirname, '../../dist/assets') - } + }, + + { + from: path.resolve(__dirname, '../../src/audio'), + to: path.resolve(__dirname, '../../dist/audio') + }, ] }), new MiniCssExtractPlugin({ From f91df1793997989b6d4c5ac2e28b97444fd40f0d Mon Sep 17 00:00:00 2001 From: Jakub Hejhal Date: Fri, 5 Jul 2024 12:37:27 +0200 Subject: [PATCH 2/4] basic html audio player playing 44 silver --- src/templates/pages/cryptograss.hbs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/templates/pages/cryptograss.hbs b/src/templates/pages/cryptograss.hbs index 8be6c3c4..488cffb3 100644 --- a/src/templates/pages/cryptograss.hbs +++ b/src/templates/pages/cryptograss.hbs @@ -10,6 +10,13 @@

Decentralized apps written by bluegrassers

Bluegrass written by cryptographers

+
+ +
+
{{!-- cryptograss nav --}}
+ + + + \ No newline at end of file From a180946217d149ff365524154cc04f29391a2f12 Mon Sep 17 00:00:00 2001 From: Jakub Hejhal Date: Sat, 6 Jul 2024 15:08:14 +0200 Subject: [PATCH 4/4] player playing state is preserved across songs --- src/templates/pages/cryptograss.hbs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/templates/pages/cryptograss.hbs b/src/templates/pages/cryptograss.hbs index c1eb1f67..eb3b2caf 100644 --- a/src/templates/pages/cryptograss.hbs +++ b/src/templates/pages/cryptograss.hbs @@ -31,6 +31,8 @@
+ 00:00 + 00:00
@@ -163,13 +165,23 @@ loadSong(currentSongIndex); function nextSong() { currentSongIndex = (currentSongIndex + 1) % playlist.length; + var is_playing = !audioPlayer.paused; + loadSong(currentSongIndex); - audioPlayer.play(); + + if(is_playing) { + audioPlayer.play(); + } } function previousSong() { currentSongIndex = (currentSongIndex - 1 + playlist.length) % playlist.length; + var is_playing = !audioPlayer.paused; loadSong(currentSongIndex); + + if(is_playing) { + audioPlayer.play(); + } } function playPause() {