**i want when i click next it should go to next and play sound of the next image but the next or previous button will go to the next image and play previous image sound. the images are working fine but it not picking the next sound any suggestion
Any simple idea to do that ? **
sliderOne =
{
isBeginningSlide: true,
isEndSlide: false,
slidesItems: [
{ icon:'assets/images/1a.png', audio:'./assets/mp3/1.wav'},
{ icon:'assets/images/2a.png', audio:'./assets/mp3/2.wav'},
{ icon:'assets/images/3a.png', audio:'./assets/mp3/3.wav'},
{ icon:'assets/images/4a.png', audio:'./assets/mp3/4.wav'},
]
};
constructor( ) {}
play(soundFile){
this.webmedia = new Audio(soundFile);
this.webmedia.load();
console.log(soundFile);
if(this.webmedia) {
// this.webmedia.pause();
}
this.webmedia.play();
}
onSlideLoad(){
// this.slides.slideNext()
console.log('It loads!')
this.slides.getActiveIndex().then((index: number) => {
console.log(index);
});
}
next(audio:any,i) {
i ++
this.slides.slideNext()
setTimeout(()=>{
this.play(audio)
},4000)
}
prev() {
this.slides.slidePrev();
}
slideChanged(audio) {
this.slides.getActiveIndex().then((index: number) => {
// this.play(soundFile)
// console.log(index);
});
}
}