avplayer

AVPlayer item buffer empty

核能气质少年 提交于 2019-12-05 13:13:14
I use AVPlayer that plays stream content. I want to know the time when buffer is empty and the time when it is ready to play. But the observers "playbackBufferEmpty" and "playbackLikelyToKeepUp" do not work every time as it needed. They sometimes work but often do not work. I use only iPad simulator iOS 6.1 under OSX 10.7.5. Here is how i set and listen observers: - (void)playAudioStream:(NSURL *)audioStreamURL { if(_audioPlayer && _audioPlayer.currentItem) { [_audioPlayer removeObserver:self forKeyPath:StatusKey]; [_audioPlayer.currentItem removeObserver:self forKeyPath:@"playbackBufferEmpty"

Does AVPlayer support closed captions delivered in a separate text file?

。_饼干妹妹 提交于 2019-12-05 12:30:43
My team produces iOS apps that play video using AVPlayer. We've recently been told that we MUST allow display of closed captions for all videos... but that the closed captions would not be coming as a track within the video files (we already support closed captions that come in this way). Instead, we'll be getting them as a separate text file. I've seen a couple references to including the caption text file in the SMIL, but I've found nothing about how to incorporate this text file into the playback experience. Does anyone have any personal experience with this, or know of any online

Play video with AVPlayer after AVCaptureMovieFileOutput

寵の児 提交于 2019-12-05 08:38:41
I've created a custom camera similar to snapchat with AVFoundation. The picture aspect works: take a picture and I display the picture. Now I'm trying to take a video and display the video. I have captured a successful video file, tested and works with MPMoviePlayer, but am unable to play it back on AVPlayer. - (void)takeVideoAction:(id)sender { NSString *outputPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"output.mp4"]; NSFileManager *manager = [[NSFileManager alloc] init]; if ([manager fileExistsAtPath:outputPath]){ [manager removeItemAtPath:outputPath error:nil]; }

AVPlayer can't resume after paused + some waiting

你。 提交于 2019-12-05 08:19:58
After .pause() if I call .play() ok it continues but if I wait 30-60 sec after .pause() and try to .play() it sometimes fail to play, AVPlayerStatus.Failed returns false AVPlayerStatus.ReadyToPlay returns true I should re-initialize player with url to make it work. Now I want to do that, if player can be played, I want to just call .play() but if not, I want to re-initialize it, my question is how to detect if player is playable? By the way it is a radio link with .pls extension Indeed theres no indication that when resuming after a large period of time the player is in limbo. (Except that in

iOS AVPlayer slow down

蓝咒 提交于 2019-12-05 08:07:12
问题 I am using AVPlayer to play online video in my project. The Video is playing well. Now I want to reduce /increase the fps of the video . Below is my code that I am using: self.asset = [AVAsset assetWithURL:self.videoUrl]; // the video player self.player = [AVPlayer playerWithURL:self.videoUrl]; self.player.actionAtItemEnd = AVPlayerActionAtItemEndNone; self.playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player]; self.playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill; [

AVPlayer's video and audio become out of sync after pausing and then resuming video

北城余情 提交于 2019-12-05 07:46:56
I'm using AVPlayer to play videos in my app. Video playback always works perfectly, except for when you pause/resume the video. If the user presses the pause button, and then resumes the video, sometimes the audio will be ahead of the video. The video resumes at the correct location, but the audio is ahead. It's as if when you press pause, the audio keeps running. When they press the pause button, all I am doing is calling the pause method of the AVPlayer , and I have also tried setting it's rate property to 0.0 which is supposed to be the exact same thing according to the documentation. I

How do I replace MPMoviePlayer notifications?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 05:28:30
In iOS 9 MPMoviePlayer and all his components are deprecated. We used MPMoviePlayerController notifications, like MPMoviePlayerLoadStateDidChangeNotification, MPMovieDurationAvailableNotification, MPMoviePlayerPlaybackStateDidChangeNotification, MPMoviePlayerReadyForDisplayDidChangeNotification , to track video service quality. But now with AVPlayerViewController I can't find properly replacement for these notifications. How do I replace these notifications now? AVPlayerViewController is a lot different in its usage from the MPMoviePlayerViewController . Instead of using notifications you use

AVPlayer is not playing in iOS 11

99封情书 提交于 2019-12-05 03:33:10
I am facing an issue with AVPlayer in iOS 11. The same code is working perfectly on iOS 10. I used DRM for playing the video. I am getting below warning : 2017-11-22 20:48:09.237095+0530 AppName[9113:3782887] [] <<<< AVOutputDeviceDiscoverySession (FigRouteDiscoverer) >>>> - [AVFigRouteDiscovererOutputDeviceDiscoverySessionImpl outputDeviceDiscoverySessionDidChangeDiscoveryMode:]: Setting device discovery mode to DiscoveryMode_None (client: AppName) 2017-11-22 20:48:09.266561+0530 AppName[9113:3782887] Presenting view controllers on detached view controllers is discouraged <Nettkino

AVPlayer Dynamic Volume control

匆匆过客 提交于 2019-12-05 02:59:22
问题 How can I change the volume of the AVPlayer Dynamically? I mean, I want to mute the volume every time a button is pressed. the given code seems to change it in compile time only. How to do it during runtime??? AVURLAsset *asset = [AVURLAsset URLAssetWithURL:[self myAssetURL] options:nil]; NSArray *audioTracks = [asset tracksWithMediaType:AVMediaTypeAudio]; NSMutableArray *allAudioParams = [NSMutableArray array]; for (AVAssetTrack *track in audioTracks) { AVMutableAudioMixInputParameters

AVPlayer got the metadata but not playing

為{幸葍}努か 提交于 2019-12-05 02:12:47
问题 I'm trying to do a very simple application, the purpose is listening an audio stream ( AAC 64 kbps ). To do so I'm using AVPlayer from the Apple AVFoundation has follow : ViewController.m #import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize playerItem, player; - (void)viewDidLoad { [super viewDidLoad]; } - (void) viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; playerItem = [AVPlayerItem playerItemWithURL:[NSURL URLWithString:@