jumpvideo-electron/resources/app.js
2024-05-21 02:45:47 +08:00

14 lines
483 B
JavaScript

import NotificationView from './notificationView.js';
// 监听该事件渲染 title和body
window.electron.ipcRenderer.on('notifier.setup', (event, id, options) => {
new NotificationView(id, options);
});
window.electron.ipcRenderer.on('notifier.beep', (eventType) => {
const audioElement = new Audio('new_msg_come.wav');
audioElement.addEventListener("canplaythrough", event => {
/* 音频可以播放;如果权限允许则播放 */
audioElement.play();
});
});