[英]Saving recorded video to photo library - Cannot convert value of type 'URL' to expected argument type 'String'
Hope you are well. 希望你很好。
I am using your SwiftyCam and its very handy to create any simple camera app. 我正在使用您的SwiftyCam及其非常方便地创建任何简单的相机应用程序。 The only problem I am having is I can not find any way to save the recorded video to gallery.
我唯一的问题是我找不到将录制的视频保存到图库的任何方法。
I tried this: UISaveVideoAtPathToSavedPhotosAlbum(url, nil, nil, nil) 我试过这个: UISaveVideoAtPathToSavedPhotosAlbum(url,nil,nil,nil)
But its giving me this error: Cannot convert value of type 'URL' to expected argument type 'String' 但是它给了我这个错误: 无法将类型“ URL”的值转换为预期的参数类型“字符串”
Can you suggest any solution? 您能提出任何解决方案吗?
According to signature 根据签名
func UISaveVideoAtPathToSavedPhotosAlbum(_ videoPath: String, _ completionTarget: Any?, _ completionSelector: Selector?, _ contextInfo: UnsafeMutableRawPointer?)
func UISaveVideoAtPathToSavedPhotosAlbum(_ videoPath:字符串,_完成目标:任何?,_completeSelector:选择器,_ contextInfo:UnsafeMutableRawPointer?)
You need to supply video path as String
type not URL
, so you can use url.path
您需要提供视频路径作为
String
类型而不是URL
,因此您可以使用url.path
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.