J'ai eu le même problème avec LLSimpleCamera, avec ce code
@property(readonly, strong, nonatomic) LLSimpleCamera *camera;
//...
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil];
[[self camera] startRecordingWithOutputUrl:path didRecord:^(LLSimpleCamera *camera, NSURL *outputFileUrl, NSError *error)
{ /*do something*/ }
Quand je catégorie d'installation beaucoup plus tôt avant d'appeler startRecordingWithOutputUrl:
le problème ne semble pas. Donc, mettez du code après setCategory:
et vérifiez. Je sais que ce n'est pas une "vraie" solution, mais ça marche pour moi après 6 heures de travail.
Ne peut pas reproduire le problème avec ce code:
[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil];
/* do some UI-related stuff, hide buttons, show bars, some animation */
[[self camera] startRecordingWithOutputUrl:path didRecord:^(LLSimpleCamera *camera, NSURL *outputFileUrl, NSError *error)
{ /*do something*/ }
post-scriptum Reproduit uniquement sur iPhone 7
@KiritModi Vérifiez la chaîne de code, son objectif c – Sonu