Ionic sound


#1

Hi
I want to play audio background on new page start.


#2

You need to add native audio.

Follow this guide

-> click me <-

To play the sound when you enter the Page use this Angular function.

ngAfterViewInit() {

YOUR CODE GOES HERE

}

This should do it :smile_cat:


#3

thank you @cherry :slight_smile:


#4

I think sounds end,I use image enable v.s.
what can I do


#5

If you want to end the music/sound when you leave the page you could also use this code.

ionViewWillLeave() {
YOUR CODE HERE
}

i strongly recommend you to read this doc to learn about wich codes you need for your project.