This class displays song information, such as the title, the author, and the album cover, on the lock screen and in the multitasking bar.
Questions tagged [mpnowplayinginfocenter]
146 questions
3
votes
2 answers
Music info showing in Command Center but not Lock Screen
Using Swift 4+, iOS 11+, Xcode 10+
I've built a music player using MPMediaPlayer and I can interact with it from the Command Center, however I would like to be able to also see it on the Lock Screen.
To be honest, I'm a bit confused as to why it's…

wayneh
- 4,393
- 9
- 35
- 70
3
votes
0 answers
Can we show lockscreen media controls without playing a media on the phone?
I'm trying to develop an app which shows lockscreen media controls (MPRemoteCommandCenter and MPNowPlayingInfoCenter).
The tricky part is that I'm not playing a media on the phone but on a remote server (like Google cast).
I managed to do it by…

Salah
- 501
- 1
- 5
- 18
3
votes
0 answers
Player controls on ios lock screen don't show up
I would like to show play/pause controls on the ios lockscren. It's an audio app using libPd.
What I did so far :
In the Info.plist :
Set the value of the key "Required background modes" to "App plays audio or streams audio/video using…

Nitenq
- 193
- 12
3
votes
0 answers
iOS Swift - MPNowPlayingInfoCenter nowPlayingInfo is slow to update/refresh
I'm currently attempting to make a music player app for iOS on Xcode. I have been able to show song information on the lockscreen / control center and made my music player play the next song when the user presses the next button on the lockscreen /…

RivasCVA
- 91
- 2
- 8
3
votes
1 answer
Is there a way to prevent AVPlayerViewController from updating the lock screen via MPNowPlayingInfoCenter?
here is my problem:
I've got an app playing audio files, updating the lockscreen info via MPNowPlayingInfoCenter.defaultCenter().nowPlayingInfo, and this part is working fine.
But in an other view, i'm playing a video with AVPlayerViewController and…

Jérémy Lapointe
- 3,742
- 1
- 10
- 7
3
votes
1 answer
MPNowPlayingInfoCenter remote controls respond incorrectly in iOS 10
In iOS 10, the control center UI was reworked and since then, play/pause control buttons respond differently.
Content that cannot be paused should not change play/pause buttons in control center on every tap.
Before iOS 10, it was probably checking…

Jakub Truhlář
- 20,070
- 9
- 74
- 84
3
votes
0 answers
MPNowPlayingInfoCenter not working with WKWebView playback
I'm using WKWebView to play audio/video and am looking to set custom MPNowPlayingInfoCenter nowPlayingInfo, but WKWebView appears to override any settings that I make. Has anyone been able to add custom lockscreen controls and metadata while using…

Aaron Wojnowski
- 6,352
- 5
- 29
- 46
3
votes
1 answer
MPNowPlayingInfoCenter nowPlayingInfo not shown while playing Video in an AVPlayer
I am working on an app that has Video streaming.
I use AVPlayer to stream the videos, on the device or using AirPlay.
When you use AirPlay, you can lock the screen and the video continues playing.
On the home screen of your device you'll get the…

Bocaxica
- 3,911
- 3
- 37
- 54
3
votes
1 answer
Remote Controls in Swift 2.0 (MPNowPlayingInfoCenter)
I'm trying to make a radio app with Swift. And I have problem with remote controls on the lock screen. Simply doesn't work - nothing on the screen. The code from the ViewController:
override func viewDidLoad() {
super.viewDidLoad()
// Do…

Szekspir
- 119
- 13
3
votes
1 answer
MPNowPlayingInfoCenter nowPlayingInfo error in Swift 2
This works with Swift 1, but reports error in Swift 2:
let image:UIImage = UIImage(named: getStringForLanguage(french: "lock_en", english: "lock_fr.") as! String)!
let albumArt = MPMediaItemArtwork(image: image)
let songInfo: NSMutableDictionary =…

Franck
- 8,939
- 8
- 39
- 57
3
votes
2 answers
Displaying AVAudio player duration and elapsed time on iPad lock screen (background)
So far this is my attempt to have the lock screen display how much time has passed (elapsed) in the audio mp3 file and how much time in total the audio mp3 file is...
Here is my array of objects:
NSArray *madMoneyArray = [NSArray…

rusdog2784
- 31
- 5
3
votes
2 answers
Showing a lock screen image using MPNowPlayingInfoCenter doesn't work
I have the following code and is working for me but it can only currently show artist and song :
let mpic = MPNowPlayingInfoCenter.defaultCenter()
mpic.nowPlayingInfo = [MPMediaItemPropertyTitle:songs[currentAudioIndex].songName,
…

Joel HJ
- 181
- 1
- 5
3
votes
1 answer
Get meta data displayed in MPNowPlayingInfoCenter's nowPlayingInfo(lock screen and remote control)
Thanks for noticing this question. I want to do something about music recommendation, and what I am doing now is leveraging MPNowPlayingInfoCenter's nowPlayingInfo, like this:
NSDictionary *metaData = [[MPNowPlayingInfoCenter defaultCenter]…

Hang
- 469
- 1
- 4
- 18
3
votes
2 answers
iOS - updating the media play/pause state in the multitasking bar
We have a working app that uses an AU graph - CoreAudio API - to play audio. The graph is always running, and the play/pause state of the various source material is managed in the graph rendering callback functions.
We successfully respond to…

Udi
- 186
- 6
2
votes
0 answers
MPNowPlayingInfoCenter does not set player controls when running iOS app on macOS with M1
I want to use iOS app on Mac with M1. It mainly works as intended in "Designed for iPad" mode, except player controls do not appear in control center as they are on iOS.
Here is the important part of the code that works perfect on iOS:
import…

dandepeched
- 424
- 5
- 20