mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 23:30:28 +03:00
Load sound file on startup (#444)
This commit is contained in:
parent
43762df998
commit
5cdad44abf
3 changed files with 12 additions and 5 deletions
|
|
@ -6,9 +6,6 @@ import cons from './cons';
|
|||
import navigation from './navigation';
|
||||
import settings from './settings';
|
||||
|
||||
import NotificationSound from '../../../public/sound/notification.ogg';
|
||||
import InviteSound from '../../../public/sound/invite.ogg';
|
||||
|
||||
function isNotifEvent(mEvent) {
|
||||
const eType = mEvent.getType();
|
||||
if (!cons.supportEventTypes.includes(eType)) return false;
|
||||
|
|
@ -238,14 +235,14 @@ class Notifications extends EventEmitter {
|
|||
|
||||
_playNotiSound() {
|
||||
if (!this._notiAudio) {
|
||||
this._notiAudio = new Audio(NotificationSound);
|
||||
this._notiAudio = document.getElementById('notificationSound');
|
||||
}
|
||||
this._notiAudio.play();
|
||||
}
|
||||
|
||||
_playInviteSound() {
|
||||
if (!this._inviteAudio) {
|
||||
this._inviteAudio = new Audio(InviteSound);
|
||||
this._inviteAudio = document.getElementById('inviteSound');
|
||||
}
|
||||
this._inviteAudio.play();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue