I'm building an audio player in Meteor for a client.
I'm getting an error when I try to create an audio object. I'm using the following code. Any idea why this is happening? Any help would be greatly appreciated.
// Define Audio
song = new Audio('/audio/waitforme.mp3');
// Define Play
play = $('#playicon');
$(function() {
$('#playicon').on("click", function() {
e.preventDefault();
song.play();
})
});
ReferenceError: Audio is not defined
at AlannaSite.js:2:14
at AlannaSite.js:12:4
at /Users/CorrinSite/.meteor/local/build/programs/server/boot.js:242:10
at Array.forEach (native)
at Function._.each._.forEach (/Users/AriKamin/.meteor/packages/meteor- tool/.1.1.9.1sd3e7j++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
at /Users/CorrinSite/.meteor/local/build/programs/server/boot.js:137:5