1
Fork 0

Added small audio functionality framework

This commit is contained in:
Jake Howard 2015-11-05 08:51:53 +00:00
parent fa720d3b28
commit 0ee5f4bfd0
2 changed files with 13 additions and 0 deletions

View File

@ -27,6 +27,11 @@ function getWindow() {
function play() {
console.log("CLICK!");
playerWindow.webContents.executeJavascript("audioPlayer.play()");
}
function setType(type) {
playerWindow.webContents.executeJavascript("changeType(" + type + ");");
}
ipc.on('play', function () {

View File

@ -0,0 +1,8 @@
var audioPlayer = new Audio();
var audioPath, audioType;
function changeType(type) {
audioType = type;
audioPath = 'audio/' + type + '.mp3';
audioPlayer.src = audioPath;
}