私のアプリからdefault iPhone Camaraをobjective cで開くことはできますか? また、ネイティブアプリから開いているときに、デフォルトのカメラから選択された画像やビデオのキャプチャを取得する可能性はありますか?デフォルトカメラについて
0
A
答えて
0
アプリからデフォルトのカメラアプリケーションを開くことはできません。アプリケーションにカメラを導入するには、UIImagePickerControllerを使用する必要があります。あなたがやりたいと思っている仕事のほとんどは、それを行います。
ここにそれを統合するコードがあります。ビデオをキャプチャする
UIImagePickerController * imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
[self presentModalViewController:imagePicker animated:YES];
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[self dismissModalViewControllerAnimated:YES];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
UIImage * image = [info objectForKey:UIImagePickerControllerEditedImage];
// You have the image. You can use this to present the image in the next view like you require in `#3`.
[self dismissModalViewControllerAnimated:YES];
}
:
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
[self presentViewController:picker animated:YES completion:NULL];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
self.videoURL = info[UIImagePickerControllerMediaURL];
[picker dismissViewControllerAnimated:YES completion:NULL];
self.videoController = [[MPMoviePlayerController alloc] init];
[self.videoController setContentURL:self.videoURL];
[self.videoController.view setFrame:CGRectMake (0, 0, 320, 460)];
[self.view addSubview:self.videoController.view];
[self.videoController play];
}
this apple documentationをお読みください。メール、電話、テキスト、マップ、YouTube、iTunesの6つの標準スキームがあります。それらを直接使用することはできません。
関連する問題
- 1. UWP CameraCaptureUI - デフォルトカメラ
- 2. についてskia antialiasについて
- 3. についてapp.listen()コールバックについて
- 4. について
- 5. についてJWKTL(JAVA)とその使い方について
- 6. Activity.getApplicationContext()について
- 7. ナビゲーションについて
- 8. UITableViewControllerについて
- 9. cssparserについて
- 10. スタティックホルダーシングルトンパターンについて
- 11. Microsoft.ServiceBus.Messaging.LeaseLostExceptionについて
- 12. についてUnicodeDecodeError
- 13. プラグインスクリプトについて
- 14. ソフトウェアライセンスについて
- 15. デーモンスレッドについて
- 16. アソシエーションについて
- 17. アンドロイドサーフェイススクリーンショットについて
- 18. ネイティブベーススケッチテンプレートについて
- 19. ポインティングデバイスについて
- 20. ファイルマネージャーについて
- 21. ループバッククエリについて
- 22. Inapppurchasesについて
- 23. についてINotifyPropertyChanged
- 24. Android:View.setAlphaについて
- 25. アナリティクスについて
- 26. についてSchedulers.newThread()
- 27. ベイジアンネットワークについて
- 28. RecycleViewについて
- 29. pthread_cond_waitについて
- 30. クローズボックスについて
はいネイティブアプリ –
でデフォルトのカメラを開くことは可能ですどのように可能ですか?私には何か解決策はありますか? – Sarmistha