This JavaScript based player should work in most HTML5 compatible browsers supporting both the <canvas> and <audio> (note: "Sample Project" 01-04 are silent) tags, including many mobile and embedded devices.
diff --git a/html5/cdgmagic_cdgplayer.js b/html5/cdgmagic_cdgplayer.js
index c4aed48..b970820 100644
--- a/html5/cdgmagic_cdgplayer.js
+++ b/html5/cdgmagic_cdgplayer.js
@@ -64,8 +64,9 @@ function set_file_prefix(file_url_prefixes)
// Ignore this call if we weren't given a file name.
if (file_url_prefixes == "") { return; };
// Construct the file paths.
- var audio_file_prefix = file_url_prefixes.split(":", 2)[0];
- var cdg_file_prefix = file_url_prefixes.split(":", 2)[1];
+ // Ensure the subfolder below: karaoke/ has the cdg/mp3 media files
+ var audio_file_prefix = "karaoke/" + file_url_prefixes.split(":", 2)[0];
+ var cdg_file_prefix = "karaoke/" + file_url_prefixes.split(":", 2)[1];
// Prepend the media files source directoy.
// file_url_prefix = "media/" + file_url_prefix;
// Stop, reset, and blank all the CD+G related stuff.
diff --git a/html5/karaoke-server.go b/html5/karaoke-server.go
new file mode 100644
index 0000000..7164663
--- /dev/null
+++ b/html5/karaoke-server.go
@@ -0,0 +1,18 @@
+package main
+
+import (
+ "log"
+ "net/http"
+)
+
+func main() {
+ http.Handle("/", http.FileServer(http.Dir(".")))
+
+ // To serve a directory on disk (/tmp) under an alternate URL
+ // path (/tmpfiles/), use StripPrefix to modify the request
+ // URL's path before the FileServer sees it:
+ // This handler serves only the karaoke content
+ http.Handle("/karaoke/", http.StripPrefix("/karaoke/", http.FileServer(http.Dir("./karaoke/"))))
+
+ log.Fatal(http.ListenAndServe(":8080", nil))
+}