Ionic sound

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

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:

1 Like

thank you @cherry :slight_smile:

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

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.

1 Like