Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(page: Page) {
super();
this._player = new TNSPlayer();
this._player.debug = true; // set true for tns_player logs
this._recorder = new TNSRecorder();
this._recorder.debug = true; // set true for tns_recorder logs
this.currentVolume = 1;
this._slider = page.getViewById('volumeSlider') as Slider;
// Set player volume
if (this._slider) {
this._slider.on('valueChange', (data: any) => {
this._player.volume = this._slider.value / 100;
});
}
}
setTimeout(() => {
this.$store.commit(SET_PLAYER, new TNSPlayer())
}, 0)
this.setCurrentShow()
constructor() {
super();
this.wingFlapAudio = new TNSPlayer();
}
playDeathAudio(): void {
const deathAudio = new TNSPlayer();
deathAudio.initFromFile({
audioFile: '~/audio/sfx_die.mp3',
loop: false
});
deathAudio.play();
}
}
getAudioPlayer() {
if (!audioPlayer) {
audioPlayer = new TNSPlayer();
audioPlayer.initFromFile({
audioFile: '~/assets/audio/success.mp3',
loop: false
});
}
return audioPlayer;
},