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
6
votes
1 answer
How to change metadata for AVRoutePickerView?
My app plays some sound and I implemented AVRoutePickerView so it can stream its sound through AirPlay or Bluetooth.
Once I tap the AVRoutePickerView, above image pops up which is good, however, with wrong image and title.
The image and title came…

Vincent Gigandet
- 918
- 10
- 21
6
votes
2 answers
What should the size of the MPMediaItemPropertyArtwork in MPNowPlayingInfoCenter be?
I want to set the image in iOS lock screen but the documentation never mentions the size of the artwork. What should it be set to?

Boon
- 40,656
- 60
- 209
- 315
6
votes
2 answers
Music control at lock screen iPhone
I am developing music app but for lock screen control i am not able to assign time duration and elapsed time
here is my code
let commandCenter = MPRemoteCommandCenter.shared()
commandCenter.previousTrackCommand.isEnabled = true;
…

Rakshit Korat
- 1,159
- 10
- 23
6
votes
3 answers
How to update MPNowPlayingInfoCenter in Swift?
In objective c, I've been using code like this to update MPNowPlayingInfoCenter:
[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:
@{ MPMediaItemPropertyArtist : @"Artist!",
MPMediaItemPropertyTitle : @"Title! }];
But in…

jmkr
- 155
- 2
- 9
6
votes
3 answers
MPNowPlayingInfoCenter : What is the best way to set MPMediaItemArtwork from an Url?
All methods I found to set MPMediaItemArtwork of MPNowPlayingInfoCenter are with local images.
MPMediaItemArtwork *albumArt = [[MPMediaItemArtwork alloc] initWithImage: [UIImage imageNamed:@"myimage"];
But I need to set this from an…

Damien Romito
- 9,801
- 13
- 66
- 84
6
votes
1 answer
ios background app is slow to respond from MPNowPlayingInfoCenter
I created a music app that is wired up to MPNowPlayingInfoCenter. I have a bunch of methods that do various things (next, pause, etc). However, when I hit the next button in MPNowPlayingInfoCenter, the app responds immediately and calls the method…

stewart715
- 5,557
- 11
- 47
- 80
5
votes
3 answers
Play/Pause next/Prev buttons are greyed out in control center
In my application, playback is controlled from control center.
When playback is going on in AVPlayer(At this time playback controls are working fine from control center), I am loading a webview with other streaming URL.
Once streaming is done…

jailani
- 2,260
- 2
- 21
- 45
5
votes
3 answers
Does google chromecast iOS SDK support lock screen controls?
I've tried to implement lock screen controls for google Chromecast video streaming app with the latest GoogleCast framework for iOS (2.1.0).
I've corrected the example Chromecast app - https://github.com/googlecast/CastVideos-ios
Have added…

Dmitry Khryukin
- 6,408
- 7
- 36
- 58
5
votes
1 answer
MPNowPlayingInfoCenter doesn't work with the simulator
I've just been wrestling with MPNowPlayingInfoCenter. After some time, I could get it working on my iPhone.
But it doesn't work on the simulator (iOS 6 and 7 tested). Am I doing something wrong, or is it explicitly not supported on the simulator?

aspyct
- 3,625
- 7
- 36
- 61
4
votes
1 answer
How to disable all the MPRemoteCommand objects from MPRemoteCommandCenter
Apple doc says "you can disable the corresponding MPRemoteCommand object by setting its enabled property to NO."
I referred Is there a public way to force MPNowPlayingInfoCenter to show podcast controls? and I was able to disable/enable a particular…

Anoop Nyati
- 339
- 2
- 11
4
votes
3 answers
MPNowPlayingInfoCenter play pause image not change
I'm using this below code. And this code is working perfectly, once application goes in background. If app not goes in background and we try to play and pause currently playing song, then play and pause image is not change. Ad every time breakpoint…

Yogendra Patel
- 813
- 2
- 8
- 24
4
votes
0 answers
MPNowPlayingInfoCenter resets almost immediately
in iOS7 I was able to set the MPNowPlayingInfoCenter.nowPlayingInfo with the standard stuff (making sure I had an AVAudioSession, with the category AVAudioSessionCategoryPlayback). Everything worked fine. Now with the update to iOS8, the information…

Jan Pittner
- 129
- 2
- 6
4
votes
0 answers
set nowplayingInfo for showing song title, artist on airplay (apple tv), not work
I have search all about the setting song info for airplay, look like simple, but I still can not make my app work well.
I use MPMoviePlayerController to play an audio.
And I have also read AirPlay overview in developer.apple.com.
I have set the…

prettydog
- 235
- 3
- 12
3
votes
0 answers
SwiftUI | How to display video title in control center of iPhone
I want to display video title in control center of iPhone. But, the title does not appear. What should I do?
Xcode 14.0, Swift 5.7, iPhone8 iOS 16.0
import SwiftUI
import AVKit
import MediaPlayer
struct ContentView: View {
var body: some View {
…

number l advantage
- 31
- 1
3
votes
0 answers
MPRemoteCommandCenter how to signal playback state when not using AVAudioPlayer
I have a simple MIDI player (Swift 5, SwiftUI, iOS14) and would like to toggle a play/pause command with MPRemoteCommandCenter. The control from the lock screen works fine with the following setup, but I'm struggling to find how to notify…

Jonathan
- 61
- 4