mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Added: addEventsListener() and addEventsListeners()
This commit is contained in:
parent
c270f0ad9a
commit
5990addfef
14 changed files with 484 additions and 464 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import * as Links from 'Common/Links';
|
||||
import { doc, SettingsGet, fireEvent } from 'Common/Globals';
|
||||
import { doc, SettingsGet, fireEvent, addEventsListener } from 'Common/Globals';
|
||||
|
||||
let notificator = null,
|
||||
player = null,
|
||||
|
|
@ -73,8 +73,7 @@ export const SMAudio = new class {
|
|||
this.supportedOgg = canPlay('audio/ogg; codecs="vorbis"');
|
||||
if (player) {
|
||||
const stopFn = () => this.pause();
|
||||
player.addEventListener('ended', stopFn);
|
||||
player.addEventListener('error', stopFn);
|
||||
addEventsListener(player, ['ended','error'], stopFn);
|
||||
addEventListener('audio.api.stop', stopFn);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue