I am using node.js to launch an HTML file to display on the localhost:8000.
None of the media files that the HTML calls work. The HTML works fine when I launch it from the windows icon. I assume that I need to change how the media files are called.
I have tried moving the media files into the native folder.
//This is how I call the HTML.
var http = require('http'),
fs = require('fs');
fs.readFile('./index.html', function (err, html) {
if (err) {
throw err;
}
http.createServer(function(request, response) {
response.writeHeader(200, {"Content-Type": "text/html"});
response.write(html);
response.end();
}).listen(8000);
});
//This is how the media file is called in the HTML (index.html).
<audio id="Whistle" src="C:\Site\Whistle.mp3" preload="auto" ></audio>
There is javascript in the HTML file that "plays" the file.
I am not getting any error messages from node.js or the web browser. It just isn't calling the file and moving on.