diff --git a/src/js/audio-controller.js b/src/js/audio-controller.js index 83e9fe7..926def0 100644 --- a/src/js/audio-controller.js +++ b/src/js/audio-controller.js @@ -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 () { diff --git a/src/js/audio-player.js b/src/js/audio-player.js index e69de29..a5a3cdd 100644 --- a/src/js/audio-player.js +++ b/src/js/audio-player.js @@ -0,0 +1,8 @@ +var audioPlayer = new Audio(); +var audioPath, audioType; + +function changeType(type) { + audioType = type; + audioPath = 'audio/' + type + '.mp3'; + audioPlayer.src = audioPath; +} \ No newline at end of file