avplayer

AVPlayer not playing from music library

删除回忆录丶 提交于 2020-01-01 05:29:11
问题 I am trying to play a song from my iPhone music library using AVPlayer. Everything seems ready to play, but the player simply won't make any sound. I've been struggling with this for a while, any help would be greatly appreciated! Note: I realize I could use AVAudioPlayer, but I would like to read the file right from my music library and, to my understanding, AVAudioPlayer doesn't support that (I would have to export the song first, taking up more time). I cannot use MPMusicPlayerController

iPhone SDK: AVAudioRecorder will not record after calling [AVPlayer play]

为君一笑 提交于 2020-01-01 05:13:06
问题 I have a view controller that uses AVPlayer. this view controller can load a modal view controler where the user can record audio using AVAudioRecorder. this is what happens: if the user plays the composition in the fist controller with [AVPLayer play] the AVAudioRecorder will not record in the modal view controller. there are no errors but the current time returned by AVAudioRecorder is 0.0; if the user dismisses the modal dialog and reloads it. AVAudioRecorder works fine. this can be

Best path from AVPlayerItemVideoOutput to openGL Texture

孤街浪徒 提交于 2020-01-01 03:27:26
问题 Been pulling my hair out trying to figure out the current best path from AVFoundation videos to an openGLTexture, most of what I find is related to iOS, and I can't seem to make it work well in OSX. First of all, this is how I set up the videoOutput: NSDictionary *pbOptions = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:kCVPixelFormatType_422YpCbCr8], kCVPixelBufferPixelFormatTypeKey, [NSDictionary dictionary], kCVPixelBufferIOSurfacePropertiesKey, nil]; self

How do you get smooth high-rate playback from AVPlayer?

£可爱£侵袭症+ 提交于 2020-01-01 03:01:30
问题 AVPlayer has a property called rate that is meant to control the playback rate. 1.0 is normal speed while values like 2.0 or 5.0 should playback at 2x and 5x respectively. Whenever I set a playback rate value higher than 1.0 (say 10.0 ), the playback is very choppy and it looks like a large number of frames are getting dropped as the player can't keep up. However, the same values in QuickTime Player (with the same movie), produce smooth playback for rates of 2x, 5x, 10x, 30x and 60x (as

remoteControlReceivedWithEvent called on iOS 7.0 device but not iOS 8.0

别等时光非礼了梦想. 提交于 2019-12-30 23:51:19
问题 I have an application that plays audio in the background. I am trying to fix a bug where the audio controls (play/pause), on the home screen (etc.), DO NOT work on iOS 8.0+ but work FINE on iOS 7.0. I have been digging through trying to figure out what the issue is and have been coming up empty. Any ideas would be greatly appreciated. Here is what I have in place. In the Project Settings: I have ensured that UIBackgroundModes is set to audio . In the AppDelegate.h: I have a member for the

remoteControlReceivedWithEvent called on iOS 7.0 device but not iOS 8.0

為{幸葍}努か 提交于 2019-12-30 23:50:31
问题 I have an application that plays audio in the background. I am trying to fix a bug where the audio controls (play/pause), on the home screen (etc.), DO NOT work on iOS 8.0+ but work FINE on iOS 7.0. I have been digging through trying to figure out what the issue is and have been coming up empty. Any ideas would be greatly appreciated. Here is what I have in place. In the Project Settings: I have ensured that UIBackgroundModes is set to audio . In the AppDelegate.h: I have a member for the

Pan to seek AVPlayer

杀马特。学长 韩版系。学妹 提交于 2019-12-30 09:36:13
问题 I am trying to pan and seek forwards and backwards in my AVPlayer. It is kind of working but the basic math of determining where the pan is translated to the length of the asset is wrong. Can any one offer assistance? - (void) handlePanGesture:(UIPanGestureRecognizer*)pan{ CGPoint translate = [pan translationInView:self.view]; CGFloat xCoord = translate.x; double diff = (xCoord); //NSLog(@"%F",diff); CMTime duration = self.avPlayer.currentItem.asset.duration; float seconds = CMTimeGetSeconds

Adjust AVPlayer Frame Rate During Playback

青春壹個敷衍的年華 提交于 2019-12-30 07:20:10
问题 Is there a way to change the rate at which frames are rendered during playback? I have a couple short 5 second videos that I would like to play at 15, 30, or 60 FPS. This would be an option to the user. I did find a frameDuration property in the AVVideoComposition class. But all this did was adjust how many frames rendered per second. 回答1: Similar question here There is a rate property in the AVPlayer. It worked very well from me. Tho the rate values ranges from 0 to 2, 1 being played at

Downloading and playing offline HLS Content - iOS 10

三世轮回 提交于 2019-12-30 06:43:31
问题 Since iOS 10, Apple has provided the support for downloading HLS (m3u8) video for offline viewing. My question is: Is it necessary that we can only download HLS when it is being played ? Or we can just download when user press download button and show progress. Does anyone has implemented this in Objective C version? Actually my previous App is made in Objective C. Now I want to add support for downloading HLS rather than MP4 (previously I was downloading MP4 for offline view). I am really

AVAudioPlayer is not playing in Background when iPhone is locked

若如初见. 提交于 2019-12-30 05:22:10
问题 Actually i fetching the songs from Documents Directory . I referred this Link:- http://www.raywenderlich.com/29948/backgrounding-for-ios , But it will play the songs from bundle only. but i want to play the songs from documents Directory. I tried Background modes in the Plist Application Does not in background = No in Plist In Appdelegate didFinishLaunchingWithOptions:- NSError *setCategoryErr = nil; NSError *activationErr = nil; [[AVAudioSession sharedInstance] setCategory: