avplayer

AVQueuePlayer frustrations (buffer underrun handling)

允我心安 提交于 2019-12-10 10:22:54
问题 I am having a hell of a time with AVQueuePlayer. Very simply, I am making it on an array of AVPlayerItems built with playerItemWithURL: and pointing to video assets on a server out on the Net. If I try to run this thing in the stimulator (sic) it plays through the first asset, begins playing the second and just dies. Sometimes it doesn't even get through the first asset. Now, I understand that the sim behaves differently than the device, so I tried it on the device as well, with the same

AVPlayer doesn't play more than one time

拜拜、爱过 提交于 2019-12-10 09:43:40
问题 I have some strange problem with playing audio through AVPlayerItem & AVPlayer. I have recorder and iPod item picker, stream from both of them are going through code like this: AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [audioSession setCategory:AVAudioSessionCategoryPlayback error:nil]; [audioSession setActive:YES error:nil]; _playerItem = [[AVPlayerItem alloc] initWithURL:_soundFileURL]; _player = [[AVPlayer alloc] initWithPlayerItem:_playerItem]; [_player play];

Custom button not working in AVPlayer iOS 11 but it's perfectly working below iOS 11?

元气小坏坏 提交于 2019-12-09 23:45:45
问题 I know possibly this is duplicate question but the question which is already exist didn't have an solution so , I'm asking again to possibly start bounty question . Here is my code which is working below iOS 11 : AVPlayer *player = [AVPlayer playerWithURL:videoURL]; // create a player view controller avcontroller = [[AVPlayerViewController alloc]init]; avcontroller.player = player; [player play]; NSNotificationCenter *noteCenter = [NSNotificationCenter defaultCenter]; [noteCenter

AVPlayer not full screen in landscape mode using iOS swift

别来无恙 提交于 2019-12-09 20:42:19
问题 I have a video view set to full screen. However while playing in the simulator, it is not running full screen. This issue is only for iPads and not iPhones. Here is my code: override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(true) let bundle: Bundle = Bundle.main let videoPlayer: String = bundle.path(forResource: "normalnewer", ofType: "mp4")! let movieUrl : NSURL = NSURL.fileURL(withPath: videoPlayer) as NSURL // var fileURL = NSURL(fileURLWithPath: "/Users/Mantas/Desktop

Play encrypted video with AVPlayer

喜欢而已 提交于 2019-12-09 08:30:23
问题 I'm implementing an application that contains video player. For some reasons video files are encrypted with AES, and size of these files can be rather big to avoid loading it to RAM as one piece. I'm looking for some way to play it with AVPlayer. Tried: 1) Custom NSURLProtocol as suggested here http://aptogo.co.uk/2010/07/protecting-resources/ Didn't work, I suggest that AVPlayer uses it's own and mine does not get called. 2) Use AVAsset to chop video in small chunks and then feed them to

No sound coming from AVPlayer

人盡茶涼 提交于 2019-12-09 01:50:51
问题 I'm trying to play an mp3 (camera shutter sound) using AVPlayer. I've stripped everything down to a simple button that, when pressed, plays the sound. All of the objects are being created correctly but when I run the app on either my iPhone or iPad (both running iOS 6) no sound is generated. And no, the mute button is not on and the volume is turned up. :) I can hear sound in other apps on both devices. Am I doing something stupid? - (void)playCameraShutterSound { NSURL *url = [[NSBundle

AVPlayer Duration is NAN with Twilio

空扰寡人 提交于 2019-12-08 17:43:20
问题 The duration property of AVPlayer.currentItem is returning NAN always with the Twilio audio urls. However, the audio is playing fine. I'm able to get the duration property of all other audio urls than Twilio. Sample url to test this issue: http://api.twilio.com/2010-04-01/Accounts/AC1db6911efe574fc890ee332f140f7e8c/Recordings/RE06adfbfd2ad2cfd5d95585ff91cb3b88.mp3 Here are the different ways that I have tried out: if (avPlayer.currentItem.status.rawValue == AVPlayerStatus.ReadyToPlay.rawValue

How to parse m3u file with AVPlayer

余生颓废 提交于 2019-12-08 16:01:04
问题 I want to get track info from m3u file headers not from id3Tags. In AVPlayer's timedMetaData properties it is only id3Tag parsing is provided. How can I get title, artist, url etc from following m3u file with AVPlayer #EXTM3U #EXT-X-ALLOW-CACHE:NO #EXT-X-TARGETDURATION:11 #EXT-X-MEDIA-SEQUENCE:0 #EXTINF:10,title="Dark Horse",artist="Katy Perry / Juicy J",url="song_spot=\"M\" MediaBaseId=\"1971116\" itunesTrackId=\"0\" amgTrackId=\"-1\" amgArtistId=\"0\" TAID=\"35141\" TPID=\"23894643\"

Audio glitch when playing two AVPlayer audio files simultaneously

不羁岁月 提交于 2019-12-08 15:50:20
问题 I have an iOS app that plays a background soundtrack with one AVPlayer and plays other sound clips "on top" with a second AVPlayer. (The sound clips are streamed from the Internet, hence the requirement for AVPlayer.) The problem is that when the second AVPlayer starts playing, it causes the background AVPlayer to stop for a fraction of a second, similar to what's described in this comment: Play multiple Audio Files with AVPlayer I am preparing the audio clips with this method: - (void

iOS Swift - AVPlayer embeded in UITableViewCell

你。 提交于 2019-12-08 11:59:06
问题 Is there a way to create a tableView with AVPlayer in UITableViewCell, and scroll without lag? I'm using replaceCurrentItemWithPlayerItem method to replace the item in the AVPlayer for each cell.. and it freezes at every cell dequeue...... 回答1: Have you tried AVPlayer.prerollAtRate:? You could display the first frame of the video while it gets ready using AVAssetImageGenerator. 来源: https://stackoverflow.com/questions/33424261/ios-swift-avplayer-embeded-in-uitableviewcell