Skip to main content
Version: iOS SDK v1.0.11

Upload Videos

You will receive a video URL on your local device after recording a video using our recorder. Use this video url and provide it to VKVideos.shared.uploadVideo in order to upload the video to our ingest pipeline.

let videoURL = URL(fileURLWithPath: "/path/to/recording.mp4")

let metadata = [
"text": "Video description",
"metadata": "xyz"
];

VKUploads.shared.upload(usingFileUrl: videoURL, withTitle: "", withTags: [], withMetadata: metadata) { (video, error) in
if let error = error {
print(error.localizedDescription)
return
}

if let video = video {
print(video.creationDate.debugDescription)
print(video.shareURL?.absoluteString ?? "")
print(video.videoID)
print(video.duration)

// Your video is uploaded
}
}

Videos are associated with the VKSession identity. Set the identity to your user's unique id and you are able to query videos based on your users.