سؤال

How can I make my app automatically stop the iPod music - if it's playing - as soon as the app is started? I need this so when people listen to music and want to use the app they don't need to pause the music first before opening the app.

هل كانت مفيدة؟

المحلول

Simple enough, import the MediaPlayer framework and tell the iPodMusicPlayer to stop or pause.

[[MPMusicPlayerController iPodMusicPlayer] stop];
[[MPMusicPlayerController iPodMusicPlayer] pause];
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top