I play a sound in viewDidLoad now when user push home button sound paused.when user run app again sound play from place that paused before.how can i stop it(no pause) when user push home button?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Have a look into the application delegate methods:
- (void)applicationDidEnterBackground:(UIApplication *)applicationYou may place code there that gets run, when your app is closed. Try keeping a pointer to you AVAudioplayer around and “stop” its currently playing content if necessary.
Be sure to restart it when the user comes back!
The documentation on the “UIApplicationDelegate Protocol Reference” helps 🙂