gpt4 book ai didi

ios - imagepickercontroller 的 photoLibrary 中的视频

转载 作者:行者123 更新时间:2023-11-30 11:04:40 26 4
gpt4 key购买 nike

我试图仅在我的 imagePickerController 中显示视频图 block 。我知道您必须更改媒体类型,我已经这样做了。我想要的只是让它仅显示视频图 block ,而不显示相机胶卷和像您在此处看到的那样的时刻

enter image description here

我只想要如图所示的一个视频图 block 。我不想先点击相机胶卷然后再观看视频。我只想要一个单独的视频图 block ,以明确其中只有视频。

enter image description here

我已经为我的图像选择器添加了 Controller

/// Selector Controller used to pick an image
open class ImagePickerController : UIImagePickerController, TypedRowControllerType, UIImagePickerControllerDelegate, UINavigationControllerDelegate {

/// The row that pushed or presented this controller
public var row: RowOf<URL>!

/// A closure to be called when the controller disappears.
public var onDismissCallback : ((UIViewController) -> ())?

open override func viewDidLoad() {
super.viewDidLoad()
delegate = self
allowsEditing = (row as? _VideoRow)?.allowEditor ?? false
mediaTypes = [kUTTypeMovie as String, kUTTypeVideo as String]

}


public func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
guard let videoURL = info[UIImagePickerControllerMediaURL] as? URL else {
return
}

(row as? _VideoRow)?.videoURL = videoURL
(row as? _VideoRow)?.value = videoURL
onDismissCallback?(self)
}

open func imagePickerControllerDidCancel(_ picker: UIImagePickerController){
onDismissCallback?(self)
}

private func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
self.navigationItem.title = "Videos"
}

}

还有为什么我不能更改标题

最佳答案

All I want is for it to show only videos tile, not camera roll and moments like you see here

那就不要使用UIImagePickerController;编写您自己的选择器。如果您使用 UIImagePickerController,您将受到它所提供的限制。它为您提供源类型 .photoLibrary.savedPhotosAlbum ,仅此而已。

关于ios - imagepickercontroller 的 photoLibrary 中的视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52858698/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com