avfoundation

Loading issues with AVPlayerItem from local URL

Deadly 提交于 2019-12-05 04:49:33
问题 I am working on a custom video player using AVPlayer. I load videos stored on the local file system in the Cache folder (NSCache). I initialize the player like this: self.playerItem = [[AVPlayerItem alloc] initWithURL:self.localURL]; [self.playerItem addObserver:self forKeyPath:NSStringFromSelector(@selector(status)) options:NSKeyValueObservingOptionInitial context:nil]; self.avPlayer = [[AVPlayer alloc]initWithPlayerItem:self.playerItem]; [self.avPlayer addObserver:self forKeyPath

AVAudioSession configuration to record and play with others

荒凉一梦 提交于 2019-12-05 04:08:09
I want to configure AVAudioSession that I can record video with audio and also play music from Music app (or any other app that is producing sound, typically internet radios apps) I configure session like this: try? AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, with: .mixWithOthers) try? AVAudioSession.sharedInstance().setActive(true, with: .notifyOthersOnDeactivation) This works the way that when my recording app is running I can start playing audio from music app and record video (also record audio as well). So far good. Now, I put my recording app to the

AVFoundation Issue With Core Animation on Mac OS X 10.7 Lion

谁说胖子不能爱 提交于 2019-12-05 04:03:09
问题 With Mac OS X 10.7 Apple has introduced AVFoundation and I'm trying to generate a simple quick time movie containing an animated shape. The problem is that the core animation does not render and I end-up having only a blank "black" video. Below is the code that I used. I've tried many variations but alas none of them work. The export status is always "Completed". The odd thing is that the UI view contains another layer setup with the same way but added to an AVSynchronizedLayer and it

SKVideoNode as texture for SCNSphere

≡放荡痞女 提交于 2019-12-05 03:45:11
i'm trying to use a SKVideoNode as a video texture source for a SCNSphere within my SCNView I'm following this answer: SKVideoNode (embedded in SKScene) as texture for for Scene Kit Node not working And with my code (pasted at the end of the question) I do get a video and an audio playing. Issue is, the mapping only occurs on a quarter of the sphere (the all xy-positive quarter). The cameraNode is inside (0,0,0) the sphere and independent of the sphereNode. I do apply a scale to the sphere node, just to reverse the nodes of the texture: sphereNode.scale = SCNVector3Make(-1, 1, 1) but

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

I wish i could mute shutter sound of camera using ios sdk [duplicate]

99封情书 提交于 2019-12-05 02:16:39
问题 This question already has answers here : AVFoundation, how to turn off the shutter sound when captureStillImageAsynchronouslyFromConnection? (9 answers) Closed 5 years ago . Right now I've been trying to mute my shutter sound when capturing an image in iOS SDK but unable to do it. Is there any way of kind of code available for it (Actually, I wanted to trace a fake person from my chat app) I've seen: Muting AVCapture shutter sound on iPhone How to mute the capture sound in AVFoundation?

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:@

Is it possible to add track title to “Now Playing Controls” menu as Music app or ITunesU do?

隐身守侯 提交于 2019-12-05 01:47:29
问题 I'm, creating a player app. I've implemented 'remoteControlReceivedWithEvent:' method and could change playing state by this buttons (apple guide). But when something playing from 'Music' or 'iTunes U' apps, than there are a song title appear under remote controls. Is there any way to show there my own text from my player app? Thanks in advance. 回答1: Yes, it's done through the MPNowPlayingInfoCenter 来源: https://stackoverflow.com/questions/9384965/is-it-possible-to-add-track-title-to-now

iOS - get programmatically queue of items currently playing

一世执手 提交于 2019-12-05 01:40:05
I want to get programmatically queue currently played in native Music App. I can use MPMusicPlayerController to get currently playing item but I want to get not only the item but whole playing queue. Is it possible to do it using AVFoundation or any other library? I'm afraid this is not possible. Apple does not give us access to this information from any libraries. bugloaf I'm pretty sure this is not possible through any public API. The Ecoute app that @sooper mentions must be using private APIs. I did a little experiment in the codebase of my own music app. First I used this code to list all