mpmusicplayercontroller

MPMusicPlayerController Does not prepare/preload correct

狂风中的少年 提交于 2020-01-04 00:31:17
问题 I am using MPMusicPlayerController so my app can play music that the user has bought through iTunes. When I select a song and start to play, there is a lag before the sound starts. I am assuming that the song is being buffered from the cloud. The problem is that I have not found a way to know when the buffering is complete and the audio actually starts. To play the song I use: _mediaController = [MPMusicPlayerController applicationMusicPlayer]; [_mediaController setQueueWithItemCollection

How do I play music using MPMusicPlayerController?

痴心易碎 提交于 2020-01-02 08:20:08
问题 Can any one suggest me how to play the music using MPMusicPlayerController in my application. Anyone's help will be very much appreciated. Thank you, Monish. 回答1: Create a MPMediaPickerController so you can choose some music from the iPod, then in the mediaPicker:didPickMediaItems: call back you do this: MPMusicPlayerController* playa; playa = [MPMusicPlayerController applicationMusicPlayer]; [playa setQueueWithItemCollection:mediaItemCollection]; [playa play]; 来源: https://stackoverflow.com

iOS - get programmatically queue of items currently playing

我与影子孤独终老i 提交于 2020-01-02 01:11:09
问题 I want to get programmatically queue currently played in native Music App. I can use MPMusicPlayerController to get currently playing item but I want to get not only the item but whole playing queue. Is it possible to do it using AVFoundation or any other library? 回答1: I'm afraid this is not possible. Apple does not give us access to this information from any libraries. 回答2: I'm pretty sure this is not possible through any public API. The Ecoute app that @sooper mentions must be using private

MPMusicPlayerController breaks lock screen controls

随声附和 提交于 2020-01-01 06:55:05
问题 I'm attempting to use MPMusicPlayerController to play apple music songs, but I can't get the lock screen controls to work. It seems as though MPMusicPlayerController overridess the remoteControlReceivedWithEvent listener. Here is how I set up my controller: self.player = [MPMusicPlayerController applicationMusicPlayer]; self.player.repeatMode = MPMusicRepeatModeNone; self.player.shuffleMode = MPMusicShuffleModeOff; [self.player beginGeneratingPlaybackNotifications]; [[NSNotificationCenter

Fade out Playback Volume on MPMusicPlayerController on iOS 5

半腔热情 提交于 2020-01-01 03:25:39
问题 I was using this answer for how to fade out music player volume in my app, but in iOS 5, this leads to the on-screen HUD for volume appearing to the user, as if they had pressed the volume buttons on the side of their device. Does anyone know a workaround that doesn't display the HUD? 回答1: I found a solution here: applicationMusicPlayer volume notification It simply directs you to add an MPVolumeView to your view. For some reason, having that in the view hierarchy prevents the volume HUD from

How To Switch music from my app to the ipod

大憨熊 提交于 2019-12-31 04:16:48
问题 i am using MusicPlayerController object in my app to play music. i know that its possible to keep playing my app music when it's terminate on the iphone ipod app. how can i do it? 回答1: There are a few things involved. You have to choose between two music players, the application music player and the iPod music player: + (MPMusicPlayerController *)applicationMusicPlayer; + (MPMusicPlayerController *)iPodMusicPlayer; If you choose the iPodMusicPlayer, music will continue to play in the

Is it posible to play iPod songs using AVAudioPlayer?

假装没事ソ 提交于 2019-12-24 19:03:22
问题 I have a question that, Is it possible to get and play the iPod library songs / playlist using AVAudioPlayer instead of using MPMusicPlayer? Thanks in advance, Chandra. 回答1: One way i tried with is just copy the song from iPod library to your app then you can play. When you close then you can delete also those songs. But makes your app heavy in terms of size. See my post. Another way i found is using AVPlayer of AVFoundation framework. This supports iPod library. For reference of AVPlayer you

playing mp3 from nsbundle

烈酒焚心 提交于 2019-12-23 04:07:33
问题 SETUP I put a mp3 into my bundle just for testing, i will have them download into the documents directory. But for now i am going to work off the bundle. I have found a couple tutorials, but not anything for what i need. The below is definitely a mix of a couple solutions and probably not the best approach. Problem How do i pull a song out of my bundle and play within the app? //Create an instance of MPMusicPlayerController MPMusicPlayerController* myPlayer = [MPMusicPlayerController

MPMusicPlayerController: combine iPodMusicPlayer and applicationMusicPlayer to prevent continuing to next track

随声附和 提交于 2019-12-23 03:48:30
问题 I have a bit of a strange problem. I have a music app that uses the [MPMusicPlayerController iPodMusicPlayer] . Everything is fine, notifications are fired for track changes and changes in playback state. I have one screen where the user needs to review one single song, I don't want him to go on to the next song in his queue. Since there is no delegate method for when a track WILL change (only DID change), to prevent the music player from continuing to the next track I use a new

How to stop MPMusicPlayerController from enabling screen locking

这一生的挚爱 提交于 2019-12-20 12:38:53
问题 I have an application that requires the iPhone screen to remain active (or not, depending on user choice). I've done this by disabling the application idle timer, which works fine and dandy until I start playing media via the MPMusicPlayerController. Due to a bug in the SDK, this then reenables the idle timer with no apparent way to disable it again. My app flow is: App starts Screen stays on <...time passes...> Play audio file Idle timer kicks in Screen turns off I have an empty audio file