Added small audio functionality framework
This commit is contained in:
parent
fa720d3b28
commit
0ee5f4bfd0
2 changed files with 13 additions and 0 deletions
|
@ -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 () {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
var audioPlayer = new Audio();
|
||||
var audioPath, audioType;
|
||||
|
||||
function changeType(type) {
|
||||
audioType = type;
|
||||
audioPath = 'audio/' + type + '.mp3';
|
||||
audioPlayer.src = audioPath;
|
||||
}
|
Reference in a new issue