Added go server to serve the content.
This commit is contained in:
1 parent
d13b95842f
commit
0f58eb33a6
3 files changed
+28
-2
No files matched your search
@@ -91,6 +91,13 @@ function toggle_2x_mode()
|
|||||||
<!--NOTE: the file is split on the colon for the mp3 and the cdg-->
|
<!--NOTE: the file is split on the colon for the mp3 and the cdg-->
|
||||||
<option value="Lionel Richie - Hello:Lionel Richie - Hello">Lionel Richie - Hello</option>
|
<option value="Lionel Richie - Hello:Lionel Richie - Hello">Lionel Richie - Hello</option>
|
||||||
<option value="Katy Perry & Juicy J - Dark Horse:Katy Perry & Juicy J - Dark Horse">Katy Perry & Juicy J - Dark Horse</option>
|
<option value="Katy Perry & Juicy J - Dark Horse:Katy Perry & Juicy J - Dark Horse">Katy Perry & Juicy J - Dark Horse</option>
|
||||||
|
<option value="Lionel Richie - All Night Long:Lionel Richie - All Night Long">Lionel Richie - All Night Long</option>
|
||||||
|
<option value="Sting - Fields of Gold:Sting - Fields of Gold">Sting - Fields of Gold</option>
|
||||||
|
<option value="Foreigner - Waiting for a Girl Like You:Foreigner - Waiting for a Girl Like You">Foreigner - Waiting for a Girl Like You</option>
|
||||||
|
<option value="Police - Every Breath You Take:Police - Every Breath You Take">Police - Every Breath You Take</option>
|
||||||
|
<option value="Frankie Avalon - Beauty School Dropout:Frankie Avalon - Beauty School Dropout">Frankie Avalon - Beauty School Dropout</option>
|
||||||
|
<option value="Queensryche - Silent Lucidity:Queensryche - Silent Lucidity">Queensryche - Silent Lucidity</option>
|
||||||
|
<option value="Amy Winehouse - MONKEY MAN:Amy Winehouse - MONKEY MAN">Amy Winehouse - MONKEY MAN</option>
|
||||||
</select>
|
</select>
|
||||||
</center>
|
</center>
|
||||||
<br><br>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.
|
<br><br>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.
|
||||||
|
|||||||
@@ -64,8 +64,9 @@ function set_file_prefix(file_url_prefixes)
|
|||||||
// Ignore this call if we weren't given a file name.
|
// Ignore this call if we weren't given a file name.
|
||||||
if (file_url_prefixes == "") { return; };
|
if (file_url_prefixes == "") { return; };
|
||||||
// Construct the file paths.
|
// Construct the file paths.
|
||||||
var audio_file_prefix = file_url_prefixes.split(":", 2)[0];
|
// Ensure the subfolder below: karaoke/ has the cdg/mp3 media files
|
||||||
var cdg_file_prefix = file_url_prefixes.split(":", 2)[1];
|
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.
|
// Prepend the media files source directoy.
|
||||||
// file_url_prefix = "media/" + file_url_prefix;
|
// file_url_prefix = "media/" + file_url_prefix;
|
||||||
// Stop, reset, and blank all the CD+G related stuff.
|
// Stop, reset, and blank all the CD+G related stuff.
|
||||||
|
|||||||
@@ -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))
|
||||||
|
}
|
||||||
Reference in new issue
Block a user