Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 使用图像选择器后,应用程序中的所有声音都将静音_Swift_Uiimagepickercontroller - Fatal编程技术网

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)
    }