An Apple SDK Media Player object that responds to remote control events sent by external accessories and system controls.
Questions tagged [mpremotecommandcenter]
74 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
3 answers
Audio controls in lock screen with AudioKit
I am using AudioKit to manage my sound engine in my app. I think AudioKit's settings are overriding something and I can't get lock screen audio controls. This is the code I have currently:
//Configure media control center
…

5AMWE5T
- 841
- 1
- 9
- 25
2
votes
1 answer
AVPlayer doesn't respond to commands from bluetooth device
My ios app uses AVQueuePlayer to play audio.
The play/pause controls work properly from Control Center and from ios lock screen, but not for commands invoked from bluetooth device. E.g., the callbacks in my app are never invoked when double-tapping…

Travis
- 2,961
- 4
- 22
- 29
2
votes
1 answer
The play/pause button does not update when play song
I'm building an music app that can integrate with CarPlay, everything is all right... I can display artist name, title, album name and some button controller on music player. However, there is an issue that when i play any song from CarPlay, the…

Le Minh
- 135
- 1
- 1
- 12
2
votes
0 answers
How to resume audio playback of other apps after deactiving the audio session and how to start audio playback in the background without mixing?
I am building a iOS app with Ionic and Capacitor. I use AVFoundation inside a Capacitor plugin which provides a public method to play an audio file accessible at a remote URL. The basics work, the audio file is successfully played. Now I want to…

speckro
- 21
- 3
2
votes
1 answer
Why addTarget does not get removed in Swift?
The target of nextTrackCommand is called multiple times when I navigate back from a screen and enter the screen again even tho i remove the target in viewWillDisappear. What did I do wrong?
override func viewDidLoad() {
super.viewDidLoad()
…

SwiftiSwift
- 7,528
- 9
- 56
- 96
2
votes
1 answer
Use player controls on iOS lock screen for Remote Control application
I'm trying to implement player controls on iOS lock screen for my Remote Control application that controls Music Player on PC.
So basically I need to control playback outside of iOS device.
I've enabled Background Modes in capabilities (Audio) and…

dandepeched
- 424
- 5
- 20
2
votes
1 answer
Get tap event Lock Screen Control(MPRemoteCommandCenter)
I have implemented Avplayer for play audio. I have used MPRemoteCommandCenter to get access on lock screen. I can get all access by:
let commandCenter = MPRemoteCommandCenter.shared()
commandCenter.pauseCommand.addTarget { (event) ->…

Fusioni Technologies
- 219
- 2
- 12
2
votes
1 answer
Multiple audios are playing simultaneously from notification control center
I have a scenario when I play a single audio file and move to control center it works fine, but if goes back to view controller (player.pause() is called there) and came back and tried to other files it works on the same controller but in the…

AshWinee Dhakad
- 671
- 7
- 11
2
votes
0 answers
MPRemoteCommandCenter not receiving command triggers
I have setup a function like this
func setupRemoteCommandCenter(enable: Bool) {
do{
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, mode: AVAudioSessionModeDefault, options:…

Viper8
- 103
- 5
2
votes
0 answers
Remove Actions From MPRemoteCommandCenter
I have 2 ViewControllers which each play a diffrent AVAudioPlayer. Each one needs a diffrent set of commands for the MPRemoteCommandCenter. Each ViewController has something like this:
let remoteCommandCenter = MPRemoteCommandCenter().shared
func…

Jacob Cavin
- 2,169
- 3
- 19
- 47
2
votes
0 answers
Objective-C Lock screen media controller hide next/prev buttons
I am developing iOS media player app with Objective-C.
There is lock screen player and I would like to hide or disable prev and next button. Here is my code:
[MPRemoteCommandCenter sharedCommandCenter].previousTrackCommand.enabled =…

Dollah han
- 21
- 3
1
vote
0 answers
How to display the control center on iOS without AVAudioPlayer?
In my iOS app, I use a third party library to play music (I use the JUCE framework).
Now I would like to show my users the control center like the one below, so they can interact with the music player from the lock screen:
To achieve that, I use…

matteoh
- 2,810
- 2
- 29
- 54
1
vote
1 answer
Where to Add Current Time and Duration Time For AVPlayer and AVAudioPlayer using MPRemoteCommandCenter
On a screen inside my app I have both an AVAudioPlayer for music and an AVPlayer for videos. The user can swap out different songs and different videos but can only play one at a time. They can play either the audioPlayer or watch videos on the…

Lance Samaria
- 17,576
- 18
- 108
- 256