写真ライブラリからサーバーに動画をアップロードするための共有拡張機能を提供するiOSアプリで作業しています。 動画の処理方法の例が見つかりません。動画を共有するにはSwift 4と共有する
は、ここに私のコードです:
if itemProvider.hasItemConformingToTypeIdentifier("public.movie") {
print ("A movie has been chosen")
itemProvider.loadItem(forTypeIdentifier: "public.movie", options: nil, completionHandler: { (data, error) in
print ("Loaded the video")
if let video = data as? Data {
// Do stuff with the movie now.
print ("The movie should be loaded now")
}
self.extensionContext?.completeRequest(returningItems: [], completionHandler:nil)
})
}
最初print
が印刷されたので、私はpublic.movie
項目の場合には、実際にです。しかし、第二と第三ではないprint
。
誰かが、映画がどのように渡され、私はそれをどう扱うことができるのか教えてください。
おかげ
チェックこの例では、あなたを助けている場合http://www.technetexperts.com/mobile/share-extension-in-ios-application-overview-with -example/ –
ありがとうございますが、あなたが言及している例は私がすでに扱っているイメージです。私はビデオがどのように渡されるか把握できません。 – radar
共有拡張は、ビデオデータではなく、選択したビデオ項目の場所(ファイルURL)を提供します – SPatel