versus card audio
This commit is contained in:
parent
68d015a577
commit
aef59d6f2a
2 changed files with 13 additions and 3 deletions
|
|
@ -1,9 +1,10 @@
|
||||||
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
|
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
|
||||||
import {ApiService} from "../../services/api.service";
|
import {ApiService} from "../../services/api.service";
|
||||||
import {combineLatest, Subject} from "rxjs";
|
import {combineLatest, Subject} from "rxjs";
|
||||||
import {combineAll, takeUntil} from "rxjs/operators";
|
|
||||||
import {Participant} from "../../../types/participant";
|
import {Participant} from "../../../types/participant";
|
||||||
import {VersusItem} from "../../../types/versus-item";
|
import {VersusItem} from "../../../types/versus-item";
|
||||||
|
import {VoiceService} from "../../services/voice.service";
|
||||||
|
import {getAudioPath} from "../../helper/tts.helper";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-versus',
|
selector: 'app-versus',
|
||||||
|
|
@ -19,16 +20,21 @@ export class VersusComponent implements OnInit, OnDestroy{
|
||||||
playersLoaded = false;
|
playersLoaded = false;
|
||||||
versusData: VersusItem | null = null;
|
versusData: VersusItem | null = null;
|
||||||
|
|
||||||
constructor(private apiService: ApiService) {
|
constructor(private apiService: ApiService, private voiceService: VoiceService) {
|
||||||
}
|
}
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.loadPlayersData();
|
this.loadPlayersData();
|
||||||
this.loadTask()
|
this.loadTask();
|
||||||
|
this.playAudio();
|
||||||
}
|
}
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
this.destroyed$.complete();
|
this.destroyed$.complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
playAudio() {
|
||||||
|
this.voiceService.playAudio(getAudioPath('Схватка!'));
|
||||||
|
}
|
||||||
|
|
||||||
loadPlayersData() {
|
loadPlayersData() {
|
||||||
const player1Data$ = this.apiService.getParticipant(this.player1);
|
const player1Data$ = this.apiService.getParticipant(this.player1);
|
||||||
const player2Data$ = this.apiService.getParticipant(this.player2);
|
const player2Data$ = this.apiService.getParticipant(this.player2);
|
||||||
|
|
|
||||||
4
src/dicts/voice.dicts.ts
Normal file
4
src/dicts/voice.dicts.ts
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
export const VoiceDict = {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue