开发者

avaudioplayer-two background music problem

开发者 https://www.devze.com 2023-03-14 09:14 出处:网络
I have two .xibs in my app.The first .xib contains a round rectangle button that opens second .xib.ViewDidLoad 开发者_如何学编程method of second .xib starts a background music(mp3 file) using AVAudioP

I have two .xibs in my app. The first .xib contains a round rectangle button that opens second .xib. ViewDidLoad 开发者_如何学编程method of second .xib starts a background music(mp3 file) using AVAudioPlayer and then shows an animation by running a sequence of images. Now second .xib button has a "back button".

If I click on the back button before animation and audio stops, reach on first xib and click on round rectangle button again then it starts two background music files.

How do I fix it?

Also, how do you stop music if a song is already playing on ipod when app's background music starts?

0

精彩评论

暂无评论...
验证码 换一张
取 消