Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-28-2011, 09:26 AM   #1 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 104
Sakura is on a distinguished road
Default AVAudioPlayer pause problem.

Hi,

I am facing a problem with the AVAudioPlayer which seems to be played automatically after pressing the home button and returning to the app again.

After playing the avaudioplayer with the "play" method, I press a button in my app to pause the music using the "pause" method, which is working. But if I press the home button while the audio player is paused, and then I return to the app, the music is being played automatically without me calling the "play" method.

Could any body help me on how to solve this.

I will really appreciate you help.
Thank you very much.
Sakura is offline   Reply With Quote
Old 12-28-2011, 08:45 PM   #2 (permalink)
Intermediate Developer
 
iRanjha's Avatar
 
Join Date: Apr 2010
Location: Earth
Posts: 136
iRanjha is on a distinguished road
Default

Are you sure you have nothing in your viewDidLoad method that calls for the music to play?
__________________
Check Out My Apps On The App Store!

SpeedyText 2.0 - FREE!
GSMCounter - FREE!
GSMCounter Pro - $0.99!

Check out my website at: http://ranjhaapplications.com

Need to contact me? Try this link: isaranjha@me.com
iRanjha is offline   Reply With Quote
Old 12-29-2011, 06:20 AM   #3 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 104
Sakura is on a distinguished road
Default

Quote:
Originally Posted by iRanjha View Post
Are you sure you have nothing in your viewDidLoad method that calls for the music to play?
Nop! I have replaced pause with stop. Everything works like a charm.
Thanks.
Sakura is offline   Reply With Quote
Old 12-29-2011, 06:25 AM   #4 (permalink)
Intermediate Developer
 
iRanjha's Avatar
 
Join Date: Apr 2010
Location: Earth
Posts: 136
iRanjha is on a distinguished road
Default

Yep, that would definitely make sense. I never knew that if music is paused and the app is reopened, it would play it. Hmm.
__________________
Check Out My Apps On The App Store!

SpeedyText 2.0 - FREE!
GSMCounter - FREE!
GSMCounter Pro - $0.99!

Check out my website at: http://ranjhaapplications.com

Need to contact me? Try this link: isaranjha@me.com
iRanjha is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 386
10 members and 376 guests
apatsufas, comicool, Creativ, Dalia, dansparrow, husthlj, LunarMoon, mer10, Murphy, pbart
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,677
Threads: 94,127
Posts: 402,916
Top Poster: BrianSlick (7,990)
Welcome to our newest member, husthlj
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:04 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0