mpnowplayinginfocenter

iOS media playback controls notification

我与影子孤独终老i 提交于 2020-02-22 07:25:13
问题 I am new to iOS, and developing a cross platform app with Flutter. I am trying to play audio from network URL, which i found it can be done using the AVPlayer . The audio plays when the app is in foreground and in background, but i can display the media playback controls like this: . i used the let mediaController = MPMusicPlayerController.applicationMusicPlayer and then calling self.mediaController.beginGeneratingPlaybackNotifications() , also providing the playing info

MPNowPlayingInfoCenter Live icon

a 夏天 提交于 2020-01-06 06:36:00
问题 I am making a radio app and noticed in the iHeartRadio app, along with the Apple Music app (Beats 1) there seems to be a Live icon for live media. I wanted to implement this into my app but have no idea on how to do it. I am using Swift 3 and MPNowPlayingInfoCenter. Any answers would help. (Icon is in the photos below called iHeart Radio LIVE icon.) Thanks! iHeart Radio LIVE Icon. iHeart Radio LIVE Icon 2. 回答1: Swift 3... the properties are in MPNowPlayingInfoCenter.h MPNowPlayingInfoCenter

MPNowPlayingInfoCenter Live icon

陌路散爱 提交于 2020-01-06 06:35:19
问题 I am making a radio app and noticed in the iHeartRadio app, along with the Apple Music app (Beats 1) there seems to be a Live icon for live media. I wanted to implement this into my app but have no idea on how to do it. I am using Swift 3 and MPNowPlayingInfoCenter. Any answers would help. (Icon is in the photos below called iHeart Radio LIVE icon.) Thanks! iHeart Radio LIVE Icon. iHeart Radio LIVE Icon 2. 回答1: Swift 3... the properties are in MPNowPlayingInfoCenter.h MPNowPlayingInfoCenter

Is MPNowPlayingInfoCenter compatible with AVAudioPlayer?

安稳与你 提交于 2020-01-02 02:48:09
问题 I start -play with AVAudioPlayer , and then set the nowPlaying dictionary like this: NSMutableDictionary *songInfo = [[NSMutableDictionary alloc] init]; MPMediaItemArtwork *albumArt = [[MPMediaItemArtwork alloc] initWithImage: [UIImage imagedNamed:@"AlbumArt"]]; [songInfo setObject:@"Audio Title" forKey:MPMediaItemPropertyTitle]; [songInfo setObject:@"Audio Author" forKey:MPMediaItemPropertyArtist]; [songInfo setObject:@"Audio Album" forKey:MPMediaItemPropertyAlbumTitle]; [songInfo setObject

Can I hide the rewind button in the iOS Lock Screen Music controls?

时光毁灭记忆、已成空白 提交于 2020-01-01 03:02:05
问题 My app doesn’t support going back to previous tracks, and I’m wondering if I can tell the lock screen music controls to hide their rewind/previous track button. I use the MPNowPlayingInfoCenter to communicate that information to the lock screen. Pretty simple question, can it be done? For instance, to only show Play/Pause, and Skip Forward? 回答1: As of iOS 7.1 there is a way to customize the controls available in the lock screen and command center (and probably many other accessories):

How to set audio details with an image on control center in Objective-C for iOS11?

[亡魂溺海] 提交于 2019-12-24 03:03:59
问题 I am trying to display audio details on control center as shown in the screenshot attached. With the below code it is working as expected in all the versions of iOS except in iOS11: if ([MPNowPlayingInfoCenter class]) { NSString *progress = (appDelegate.audioPlayer.progress == 0 || appDelegate.audioPlayer == nil ) ? @"0.0" : [NSString stringWithFormat:@"%f",appDelegate.audioPlayer.progress]; NSString *duration = (appDelegate.audioPlayer.progress == 0 || appDelegate.audioPlayer == nil ) ? @"0

Music info showing in Command Center but not Lock Screen

落花浮王杯 提交于 2019-12-22 09:31:31
问题 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 showing/working in the Command Center as I have not written any code to do this. Nevertheless, I would also like it to show in the Lock Screen. This is what I have done so far: 1) I'm using the applicationMusicPlayer and made certain something is

MPMediaItemArtwork init(image:) deprecated in iOS 10.0

你离开我真会死。 提交于 2019-12-21 07:25:32
问题 Apple has deprecated init(image:) method in MPMediaItemArtwork in iOS 10. What is the new alternative. the class shows interface shows method below to be available in the new OS version public init(boundsSize: CGSize, requestHandler: @escaping (CGSize) -> UIImage) Anyone know how to use it? Also question 2, part of the previous question: Does showing now playing metadata on the lock-screen and control-center using MPNowPlayingInfoCenter work in the simulator? 回答1: You can use the following

Handling playback events in CarPlay with MPNowPlayingInfoCenter

吃可爱长大的小学妹 提交于 2019-12-21 06:25:30
问题 I am trying to build a sample audio app with CarPlay integration. The app is a test project - no API, no streaming, no complicated UI. Just a short list of song titles with the functionality to select one and play it. My goal is to handle the callback when the play button is pressed on the Now Playing screen and play a file. I don't have any problems setting up the MPPlayableContentManager, MPPlayableContentDataSource and MPPlayableContentDelegate. My content is parsed from a JSON file and it

Handling playback events in CarPlay with MPNowPlayingInfoCenter

点点圈 提交于 2019-12-21 06:25:24
问题 I am trying to build a sample audio app with CarPlay integration. The app is a test project - no API, no streaming, no complicated UI. Just a short list of song titles with the functionality to select one and play it. My goal is to handle the callback when the play button is pressed on the Now Playing screen and play a file. I don't have any problems setting up the MPPlayableContentManager, MPPlayableContentDataSource and MPPlayableContentDelegate. My content is parsed from a JSON file and it