Share Video to Facebook
- You can create a share dialog with sharing content type VideoShareContent object that is supported in the Facebook SDK for Swift.
- In order to share video the user must have the native Facebook for iOS app installed.
- Photos & Videos must be less than 12MB in size.
AVAsset URL: "assets-library://asset/asset.MOV?id=\(videoId[0])&ext=MOV"
func fbUpload(path:URL){ let video = Video(url: path) var content = VideoShareContent(video: video) content.video = video showShareDialog(content) } func showShareDialog<C: ContentProtocol>(_ content: C, mode: ShareDialogMode = .automatic) { let dialog = ShareDialog(content: content) dialog.presentingViewController = self.aViewController dialog.mode = mode do{ try dialog.show() } catch (let error){ print(error) } }
Comments
Post a Comment