whoops
This commit is contained in:
parent
a11224a2f8
commit
9ad745879e
11
renderer.js
11
renderer.js
@ -1,11 +1,8 @@
|
|||||||
const unMuteSound = new Audio('./assets/unmute.mp3')
|
|
||||||
const muteSound = new Audio('./assets/mute.mp3')
|
|
||||||
|
|
||||||
const { ipcRenderer } = require('electron')
|
const { ipcRenderer } = require('electron')
|
||||||
|
|
||||||
onload = () => {
|
onload = () => {
|
||||||
const webview = document.querySelector('webview')
|
const webview = document.querySelector('webview')
|
||||||
webview.openDevTools()
|
//webview.openDevTools()
|
||||||
webview.addEventListener('console-message', (e) => {
|
webview.addEventListener('console-message', (e) => {
|
||||||
if (e.message === "Constructed RTCPeerConnection") {
|
if (e.message === "Constructed RTCPeerConnection") {
|
||||||
console.log("Connected to server")
|
console.log("Connected to server")
|
||||||
@ -20,16 +17,14 @@ onload = () => {
|
|||||||
|
|
||||||
ipcRenderer.on('ping', (event, message) => {
|
ipcRenderer.on('ping', (event, message) => {
|
||||||
if (message === 'mic-open'){
|
if (message === 'mic-open'){
|
||||||
console.log("mic is open")
|
console.log("talking")
|
||||||
webview.sendInputEvent({keyCode: 'Backspace', type: 'keyDown'});
|
webview.sendInputEvent({keyCode: 'Backspace', type: 'keyDown'});
|
||||||
webview.sendInputEvent({keyCode: 'Backspace', type: 'char'});
|
webview.sendInputEvent({keyCode: 'Backspace', type: 'char'});
|
||||||
//unMuteSound.play()
|
|
||||||
}
|
}
|
||||||
if (message === 'mic-closed'){
|
if (message === 'mic-closed'){
|
||||||
console.log("mic is closed")
|
console.log("not talking")
|
||||||
webview.sendInputEvent({keyCode: 'Backspace', type: 'keyUp'});
|
webview.sendInputEvent({keyCode: 'Backspace', type: 'keyUp'});
|
||||||
webview.sendInputEvent({keyCode: 'Backspace', type: 'char'});
|
webview.sendInputEvent({keyCode: 'Backspace', type: 'char'});
|
||||||
//muteSound.play()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user