在 OS 3.1 中使用 UIImagePickerController 从 PhotoLibrary 中选取视频
我正在尝试从照片库中选择一个视频。原则上我知道如何做到这一点,您将图像选择器的 mediaType 设置为 NSArray,并以 kUTTypeMovie 作为其唯一对象。 但这似乎不适用于 iPhone 3G。从 OS 3.1 开始,您可以将收到的视频存储在照片库中。当您在“照片”应用程序中开始构建时,会出现视频。然而,这在使用 UIImagePickerController 时不起作用。控制器报告它仅支持图像。当您尝试使用 kUTTypeMovie 设置控制器的媒体类型时,它实际上会崩溃。
如果您不指定媒体类型,则选择器中仅显示图像。
有人设法从照片库中挑选视频吗?如果是的话,它只适用于 3gs 还是也适用于 3G?
问候
本
I am trying to pick a video from the photo library. In principle I know how to do it you set the mediaType of the image picker to an NSArray with kUTTypeMovie as its only object.
But this doesn't seem to work on an iPhone 3G. Since OS 3.1 you can store videos you've received in your photo library. When you start the build in 'Photos' application the videos appear. However this doesn't work using the UIImagePickerController. The controller reports that it only supports images. When you try to set the mediaType of the controller with kUTTypeMovie it actually crashes.
If you don't specify the media type only images are shown in the picker.
As anyone managed to pick a video from the photo library? If yes did it only work on the 3gs or on the 3G as well?
Regards
Ben
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我让图像选择器在 3g 和 3gs 上工作来选择视频。
并获取所选视频
I got the imagepicker working on a 3g and a 3gs to pick videos.
And to get the picked video
嘿,我也无法使用上述代码获取 3G 上的电影对象。我的 3G 上就崩溃了。不过,它可以在我的 3GS 上运行,但问题是它在照片库中显示图像和电影的混合。我尝试了以下代码:
在运行 OS 3.1.2 的 3GS 上,它向我显示存储在我的照片库中的视频和图像。
而如果我尝试执行以下操作:
那么它向我显示的只是存储在相机胶卷中的视频,而没有其他内容。有人可以帮忙吗?
Hey, I am also unable to get movie objects on 3G using the above mentioned code. It crashes on my 3G. It however works on my 3GS, but the issue is it shows a mix of both images and movies in photo library. I tried the following code:
and on my 3GS running OS 3.1.2, it shows me videos cum images stored in my photo library.
Whereas if I try doing the following:
Then all it shows me is videos stored in Camera Roll, and nothing else. Can somebody help ?