avplayer

AVPlayer playback fails while AVAssetExportSession is active as of iOS 10

亡梦爱人 提交于 2019-12-17 15:42:38
问题 AVPlayer will randomly just play audio, not showing the video track... Playing video correctly with AVPlayer while having an active compression session of AVAssetExportSession:exportAsynchronouslyWithCompletionHandler is now failing. It seems it causes some instability that persists until the app goes into the background and comes back. Examining AVURLAsset when video playback fails, there is a video track even though there is no video output. I also don't get any errors from the compressor

AVPlayer rate property does not work?

こ雲淡風輕ζ 提交于 2019-12-17 15:40:46
问题 so it would appear that the only values that actually work are 0.0, 0.5, 1.0, and 2.0... i tried setting it to 0.25 since I want it to play at 1/4th of the natural speed, but it played it at 1/2 of the natural speed instead. can anyone confirm this? 回答1: Confirmed. I actually had a ticket with Apple DTS open for this issue and a bug filed. The only supported values are 0.50, 0.67, 0.80, 1.0, 1.25, 1.50, and 2.0. All other settings are rounded to nearest value. 回答2: The play rate restriction

Done button click event in AVPlayerViewController

北战南征 提交于 2019-12-17 12:46:15
问题 I want to play local video in AVPlayerViewController but did not find click event of Done button. My video is able to play in AVPlayerViewController but I did not find next button , previous button and done button click event. 回答1: Officially there is no Done Button click event, a engineer from Apple said about it here. As for my research, I found out that there is one but really indirect way to get an event if Done Button was clicked. I found out that the only variable of

Knowing when AVPlayer object is ready to play

假装没事ソ 提交于 2019-12-17 07:02:39
问题 I'm trying to play an MP3 file that is passed to an UIView from a previous UIView (stored in a NSURL *fileURL variable). I'm initializing an AVPlayer with: player = [AVPlayer playerWithURL:fileURL]; NSLog(@"Player created:%d",player.status); The NSLog prints Player created:0, which i figured means it is not ready to play yet. When i click the play UIButton , the code i run is: -(IBAction)playButtonClicked { NSLog(@"Clicked Play. MP3:%@",[fileURL absoluteString]); if(([player status] ==

Using NSURLProtocol to implement play while downloading for AVPlayer on iOS

£可爱£侵袭症+ 提交于 2019-12-13 15:26:34
问题 I'm trying to play a mp4 video on my server and I'd like to cache this video to disk simultaneously. I know that I can just use 2 requests to do this, one for download another one created by AVPlayer to play the video, but this will waste the network bandwidth. So I need to use just one outer request to download the data and capture all NSURLRequest from AVPlayer in MyNSURLProtocol and manually create NSHTTPURLResponse for them. This is how the workflow looks like: AVPlayer <-->

Playing HLS (m3u8) in Cocoa OS X AVPlayer - Swift

旧城冷巷雨未停 提交于 2019-12-13 14:26:08
问题 Basically I am trying to play an m3u8 (HLS Live Stream) using AVPlayer in Cocoa Swift. I'm relatively new to the language, so basically grabbed some example code for playing local video files and tried modifying it to play a live stream... But get this instead: http://i.stack.imgur.com/bU9GM.png This is what I got so far (commented lines are to play local file, which does work): import Cocoa import AVKit import Foundation import AVFoundation class ViewController: NSViewController { @IBOutlet

iOS AVPlayer showing screen with a cross line on Play icon

三世轮回 提交于 2019-12-13 14:13:07
问题 Screen Shot of AVPlayer error Below is the code snippet, url is the the video url. This error occurs randomly. I'm unable to trace what is the issue. Also the video is stored in cloud and video buggers to play on the AVPlayer. Is anything missing in the below code. + (void)presentVideoForURL:(NSURL *)URL parentViewController:(UIViewController *)parentViewController { AVAudioSession *audioSession = [AVAudioSession sharedInstance]; NSError *setCategoryError; if (![audioSession setCategory

What is the best way to play video in UITableViewCell

一个人想着一个人 提交于 2019-12-13 12:21:10
问题 I'm trying to make auto-play video in UITableViewCell depending on cell position. I'm using the AVPlayer Here is my code: __weak typeof(self)this = self; NSString* videoPath = @"http://test.com/test.mp4"; AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:[NSURL URLWithString:videoPath] options:nil]; NSArray* keys = [NSArray arrayWithObjects:@"playable",nil]; [asset loadValuesAsynchronouslyForKeys:keys completionHandler:^(){ AVPlayerItem* playerItem = [AVPlayerItem playerItemWithAsset:asset]

I need to implement music player using AV Player in SWIFT

自闭症网瘾萝莉.ら 提交于 2019-12-13 09:44:58
问题 I need to implement streaming music player using AV Player in SWIFT that music file Stored in server.Please help me to any one..How to implement this one 回答1: According to this: http://www.techotopia.com/index.php/IOS_8_Video_Playback_using_AVPlayer_and_AVPlayerViewController You could add following code in your ViewController, like viewDidLoad method or viewWillAppear, depends on the view will show repeatedly or not. If Yes, add it in the viewWillAppear method. let player = AVPlayer(URL: url

AVPlayerViewController play/pause issue in iOS

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 07:37:44
问题 I am working on the iOS application. This application base on the NEWS media. I am playing the small video of highlighted News. I am facing a stranger problem with AVPlayerViewController . When i play the video everything is fine. When i go to offline the buffer video play perfect & after the play buffer video, the video stops but the progress bar(Slider) continuously in play state while the video has been stopped. For more clearance please watch this GIF image : Please visit this link for