Swift 使用图像选择器后,应用程序中的所有声音都将静音
使用图像选择器后,应用程序中的所有声音都将静音 加载图像选择器时没有单独的音量设置 为什么会这样 我的代码Swift 使用图像选择器后,应用程序中的所有声音都将静音,swift,uiimagepickercontroller,Swift,Uiimagepickercontroller,使用图像选择器后,应用程序中的所有声音都将静音 加载图像选择器时没有单独的音量设置 为什么会这样 我的代码 @IBAction func tapRecording(_ sender: UIButton) { if UIImagePickerController.isSourceTypeAvailable(.camera) { imagePicker.delegate = self imagePicker.sourceType =
@IBAction func tapRecording(_ sender: UIButton) {
if UIImagePickerController.isSourceTypeAvailable(.camera) {
imagePicker.delegate = self
imagePicker.sourceType = .camera
imagePicker.mediaTypes = [kUTTypeMovie as String]
imagePicker.videoMaximumDuration = 120 // or whatever you want
imagePicker.videoQuality = .typeMedium
imagePicker.allowsEditing = false
player.pause()
playButton.isHidden = false
exampleLabel.isHidden = false
self.navigationController?.present(imagePicker, animated: true)
}
}
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
dismiss(animated: true, completion: nil)
let videoURL = info[.mediaURL] as! URL
let vc = UIStoryboard(name: "Growth", bundle: nil).instantiateViewController(identifier: "GrowthSaveViewController") as? GrowthSaveViewController
vc!.videoUrl = videoURL
vc?.videoData = videoData
self.navigationController?.pushViewController(vc!, animated: true)
}