IOS - Pause and Unpause Currently Playing Music

时间秒杀一切 提交于 2019-12-19 10:32:52

问题


I am working on a IOS app that I want to have the functionality to pause and unpause music that is currently playing through the ipod, just like the ipod's play/pause button. Is there anyway to do that through IOS? The only answers I have found for this is for dealing with songs and sounds played locally through the app.

Any help would be fantastic. Thanks so much!


回答1:


[[MPMusicPlayerController systemMusicPlayer] play];
[[MPMusicPlayerController systemMusicPlayer] pause];


来源:https://stackoverflow.com/questions/7043365/ios-pause-and-unpause-currently-playing-music

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!