IOS - 暂停和取消暂停播放音乐 [英] IOS - Pause and Unpause Currently Playing Music

查看:623
本文介绍了IOS - 暂停和取消暂停播放音乐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个IOS应用程序,我希望它具有暂停和取消暂停当前通过ipod播放的音乐的功能,就像ipod的播放/暂停按钮一样。无论如何通过IOS做到这一点?我找到的唯一答案是处理通过应用程序在本地播放的歌曲和声音。

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!

推荐答案

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

这篇关于IOS - 暂停和取消暂停播放音乐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆