373
questions
0
votes
1
answer
37
views
Debugprint mysteriously causes notifications to fire
MRE
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(....
0
votes
1
answer
483
views
Cannot convert value of type 'PlayParameters?' to expected argument type '[MPMusicPlayerPlayParameters]'
I am trying to create a music player with Swift and MusicKit, but I am getting this error when trying to load up the queue with the selected album from MusicKit. I don't get why the playparameters for ...
1
vote
1
answer
412
views
iOS: Apply audio modifications to Music library content
I'm working on an iOS/Flutter application, and am trying to work out if it's possible to play audio from the Music library on iOS with audio modifications (e. g. equalization settings) applied.
It ...
0
votes
1
answer
596
views
SwiftUI Trying to use MPMusicPlayerController and playbackState
I am fairly new to SwiftUI, and I am struggling to use the Apple Swift Documentation. I'm trying to get the current state of the now playing music, hopefully printing something like
paused
or
...
1
vote
2
answers
371
views
MPMusicPlayerController.systemMusicPlayer locks main thread with _establishConnectionIfNeeded on iOS 14.5
An app that should play music now locks the main thread with following errors:
[SDKPlayback] applicationQueuePlayer _establishConnectionIfNeeded timeout [ping did not pong]
[SDKPlayback] SYNC-...
1
vote
0
answers
138
views
MPMusicPlayerController does not playing Music on tvOS
Hey there im trying to play music by MPMusicPlayerController.
But when i start to prepare the player it goes into a timeout. (not in the completionHandler)
Here is the Error:
[SDKPlayback] ...
1
vote
1
answer
238
views
Swift skip current song playing on iPhone
I would like to display info and skip the current song being played by the iPhone. I understand MPMusicPlayerController can do this for apple music. However, I would like to display and skip the ...
1
vote
1
answer
156
views
MPMusicController play/pause API functions regardless Media Library permission accepted or denied
We are using MPMusicController in order to play short sound, but from iOS 13.4 onwards the application started crashing due to missing NSAppleMusicUsageDescription key in the info.plist.
However, ...
3
votes
1
answer
709
views
MPMusicPlayerController fails to play Apple Music songs
I am using an instance of MPMusicPlayerController.systemMusicPlayer to enqueue an array of store IDs. This has worked for months now. Earlier today I updated to iOS 14.3, and the player is now failing ...
3
votes
0
answers
293
views
Displaying and Playing MPMediaItem songs in retrieved + last played order
I'm building an app that makes use of MPMusicPlayerApplicationController to play music from a user's local music library.
The songs from the library are retrieved like so:
func retrieveMusic() {
...
0
votes
1
answer
380
views
Get info about background music from another app
I'm wondering if there is a way to get track info for an audiobook playing in the background via Audible or song playing via Spotify while I'm inside my app.
Right now I know that I can detect if ...
0
votes
1
answer
102
views
AVAudioPlayer doesn't play sound when MPMusicPlayerController is playing on iOS
I have an app that plays various musical sounds using AVAudioPlayer. It lets people select a song from their library and plays it with MPMusicPlayerController. It used to work that they could jam with ...
1
vote
0
answers
235
views
Apple Music API, 'stations' Resource Type Playback
I am trying to play 'stations' resources from Apple Music Catalogue.
I retrieve the radio station via the Apple Music API i.e. Search for Catalogue Resources
which gives me a station response (...
0
votes
2
answers
124
views
I am not able to get any output in console using NotificationCenter in swift iOS
I am new to Swift Programing Languge and I'm trying to get a output when the song changes. Code has no any error.
Below is my code
import UIKit
import MediaPlayer
class ViewController: ...
1
vote
0
answers
434
views
MPMusicPlayerController not starting (on foreground) when podcast app is being used on device
I am working on an IOS app that after some interactions with the user and some timer finishes running, I am playing music from the music library. It was working fine with local music and audiobooks (...
9
votes
1
answer
4k
views
Difference between AVAudioPlayer AVPlayer AVQueuePlayer MPMusicPlayerController MPRemoteCommandCenter MPNowPlayingInfoCenter for an iOS 13+ app
All of the threads on this topic are really old (5+ yo), and I can't seem to form a clear MODERN approach, so hopefully this can be summarized for 2020 (Swift 5, Xcode 11).
If you were to build an ...
2
votes
1
answer
1k
views
iOS 13.4 accessing MPMusicPlayerController.systemMusicPlayer crashes the app
I have a player control in the app the controls system music player (Prev Play/Pause Next).
To show proper Play/Pause state I'm adding an observer to MPMusicPlayerControllerPlaybackStateDidChange ...
1
vote
0
answers
460
views
Swift MPMusicPlayerController ApplicationQueuePlayer skipToNextItem() function causes the queue to be cleared
I'm working on a music playing app that shows a list of Apple Music songs in a TableView and plays them in a certain order, but am having issues with the MPMusicPlayerController's application queue ...
3
votes
0
answers
139
views
MPMediaItem and AVPlayerItem playback sequence in background
I'm having an issue with playing sequences of different kinds of items in a background.
In an app I'm working on we've introduced playlists which contain both content provided by the app and Apple ...
1
vote
1
answer
70
views
Initialising MPMusicPlayerMediaItemQueueDescriptor
Within a function how do you initialise an MPMusicPlayerMediaItemQueueDescriptor, as the first step in the prepend method part of Music Kit? I think I need my media query to become a queue descriptor, ...
1
vote
0
answers
225
views
MPMusicPlayerApplicationController stops playing in background after exactly 30 songs
I have an app which plays songs from Apple Music using MPMusicPlayerController.applicationQueuePlayer. I am constantly connecting to my backend and updating the song queue using player.prepend(...
3
votes
1
answer
3k
views
MPMusicPlayerController fails to play from Apple Music
I'm trying to play songs from Apple Music and it is failing with the following logs:
2019-09-26 00:15:57.790999+0200 [1886:463973] [core] "Error returned from daemon: Error Domain=com.apple.accounts ...
0
votes
1
answer
261
views
MPMusicPlayerController skips to next song after continuing playback
I am using the MPMusicPlayerController to play songs from Apple Music. I am periodically (every several seconds) changing the song queue using
setQueue(with: MPMusicPlayerStoreQueueDescriptor(...
0
votes
1
answer
31
views
When a song slider is held down too long, the positionSlider.value is too big
I am somewhat new to Swift. My song position slider works pretty well. It is smooth. The only problem that I've found is that it produces odd results if you hold down the slider in the same spot ...
2
votes
1
answer
310
views
Issue Playing Apple Music Song with playbackStoreID
I am trying to play an individual apple Music song using a playbackStore Id but whenever I attempt to play it I get this error
The user is properly authenticated and the playback store id seems to ...
8
votes
1
answer
416
views
Playing (non library) Apple Music content - request fails
I'm trying to play an album, using the following code…
let predicate = MPMediaPropertyPredicate(value: "1459938538", forProperty: MPMediaItemPropertyAlbumPersistentID)
let iCloudPredicate = ...
1
vote
1
answer
306
views
iOS 12.2 MPMusicPlayerController reporting incorrect playback state
MPMusicPlayerController is reporting playback state as paused when a song reaches the end, and is also reporting playback state as paused after queueing a song, even after an explicit call to .Stop().
...
0
votes
1
answer
240
views
How to play mp3 url & document Directory mp3 file To MPMusicPlayerController
Hello I am new in iOS development. I am working on music player app. I want my player to display on notification tab as well. For this I need to use MPMusicPlayerController, because this can't be ...
7
votes
0
answers
346
views
MPCPlayerRequestErrorDomain Code=1000 "Failed to send command 0"
let cloudServiceController = SKCloudServiceController()
let musicPlayer = MPMusicPlayerController.systemMusicPlayer
self.cloudServiceController.requestCapabilities { capabilities, error in
...
3
votes
1
answer
2k
views
How to know when MPMusicPlayerController changes playing item naturally
I am using the MPMusicPlayerController to create a music player in my app. I have got it all working great except for one small issue:
When the songs changes naturally - one song finishes and the ...
5
votes
1
answer
1k
views
Rearrange MediaPlayer Music Queue [iOS]
I am really struggling to figure something out and I've looked all over the internet and I can't find an answer. As you know, music apps like Spotify and Apple Music itself let the user rearrange the ...
0
votes
0
answers
638
views
How do I get the lyrics of the currently playing song in Swift 4?
I am getting the Current Song playing as an MPMediaItem and I can successfully retrieve the title, artist and song length. However when I try to get the lyrics nothing shows up in the text field that ...
0
votes
1
answer
202
views
Using MPVolumeView, my thumb image shows up underneath the default thumb image using setVolumeThumbImage
I am using an MVVolumeView and I am trying to place the default thumb image with my own.
I have a 25 pixel RED square asset that I named VolumeButtonRed.png to test this procedure.
Here is the code ...
0
votes
2
answers
1k
views
iOS MPMusicPlayerController song changed notification does not have a song object with it
I am developing an app that listens to song changes of the MPMusicPlayerController.
For that, I am adding the following observer:
NotificationCenter.default
.addObserver(self,
...
3
votes
0
answers
346
views
MPMusicPlayerController applicationMusicPlayer doesn't play some songs
I don't know what the issue is, I can't play any of the songs for Adele Essentials, https://itunes.apple.com/us/playlist/adele-essentials/pl.efaeab71d9cd4e079d9d1097c3b6b525
420075084 1051394215 ...
0
votes
1
answer
220
views
EXC_BAD_ACCESS and MPMusicPlayerController
I wrote an app that I haven't worked on in awhile. It started in Xcode 7.3.1, but worked fine in Xcode 8.3.3. I'm getting EXC_BAD_ACCESS when I try to run it on an iPhone 8 with iOS 11.4.1 (I wish I ...
0
votes
1
answer
334
views
Is there any way to get notifications on Apple Music playback in the background?
I know this issue has been asked numerous times here (*), but years go by and still this is a problem. If anybody has ANY pointers to try, I'll be most thankfull.
The problem is that I want to be ...
3
votes
0
answers
414
views
Apple music not playing some songs in ios
I am working with Apple music and using MPMusicPlayerController.systemMusicPlayer for playing music with the unique song id(870697325). some song working fine but some does not work. it just displays ...
1
vote
0
answers
2k
views
now playing info not showing on lock screen
I am switching my music playing app from AVPlayer to MPMusicPlayerController. When the App uses AVPlayer, the now playing info shows as expected. But if I use MPMusicPlayerController, I see the now ...
0
votes
1
answer
607
views
What is the difference between an applicationQueuePlayer and an applicationMusicPlayer?
In the Apple documentation, it says
The application queue music player provides more functionality and greater control over the music played than the application music player.
But what control and ...
1
vote
0
answers
174
views
Spotify track is not playing after I stopped `MPMusicPlayerController.systemMusicPlayer` track
In my application, I am using MPMusicPlayerController.systemMusicPlayer for the playing song of Apple music, it's working fine. But when I play back Spotify track using playSpotifyURI it's not working....
3
votes
0
answers
173
views
Export music file from Apple music library to document directory
I'm exporting a music file from the Apple music library to my document with this code:
func exportMusic(_ filename: String,_ dir: String,_ assetURL: URL, completionHandler: @escaping (_ fileURL: URL?,...
0
votes
1
answer
258
views
How to resume Audio using Mpmusicplayer after pause audio in swift 4.1(IOS 11)
I am working on Audio playing app using "MpmusicPlayer" and want to resume it after paused.
I am using "self.appMusicPlayer.currentPlaybackTime" but it is not working in swift 4.1 (IOS 11).
Is there ...
0
votes
1
answer
1k
views
MPMusicPlayerController.shuffleMode cannot be set
Hello I have a question about the MPMusicPlayerController in Swift. I am currently working on a Music App were I want to shuffle music by songs. So when the App Starts it basically sets the Playback ...
6
votes
0
answers
759
views
How to detect the end of a song in MusicKit?
I am attempting to use Apple's Music Kit within my application to listen to music. My issue is that the first song that plays will continually repeat. The first song plays correctly by using the ...
3
votes
1
answer
826
views
MPMusicPlayerControllerMutableQueue insert an Apple Music song not working
So I have been trying to use the MusicKit APIs for a few days now. I have been attempting to use the MPMusicPlayerApplicationController and MutableQueue APIs.
I have queue initialized already using ...
0
votes
1
answer
1k
views
Apple Music Song Playback Not Working
Trying to play song using MPMusicPlayerController using the following code
let musicPlayerController = MPMusicPlayerController.systemMusicPlayer
func beginPlayback(itemID: String) {
let ...
1
vote
1
answer
208
views
MPMusicPlayerController and iOS 11.3
I have an iOS app which works fine on iOS 6.0 through 11.2, but just started failing on 11.3(.1) and 11.4 betas. The app plays the songs in a playlist from the local device. I have extracted the basic ...
0
votes
2
answers
493
views
changing and hiding Volume HUD(the overlay of volume) while play music library in iOS 11
I am using MPMusicPlayerController.applicationQueuePlayer to control to play internal music.
extension MPVolumeView {
var volumeSlider: UISlider? {
showsRouteButton = false
...
0
votes
1
answer
131
views
MPMusicPlayerController take 7 sec to start playing in Xamarin.IOS ( IOS v11.3)
I am developing Xamarin.IOS Application. In my application, I used User music for alarm purpose in my application. I use MPMusicPlayerController.ApplicationMusicPlayer to Play alarm.
When I tried to ...