Address tracking and notification sounds.

This commit is contained in:
softsimon
2020-02-26 04:29:57 +07:00
parent b45f5c31cd
commit 12c9b80a64
13 changed files with 110 additions and 25 deletions

View File

@@ -0,0 +1,21 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class AudioService {
audio = new Audio();
constructor() { }
public playSound(name: 'magic' | 'chime' | 'cha-ching') {
try {
this.audio.src = '../../../assets/sounds/' + name + '.mp3';
this.audio.load();
this.audio.play();
} catch (e) {
console.log('Play sound failed', e);
}
}
}