Skip to main content
Version: iOS SDK v1.0.11

Upload While Recording

0 seconds to upload - Videos instantly available.

Setup

Follow the steps to record a clip.

In your viewDidLoad (or any time before you call VKRecorder.shared.startSession()), configure your videoConfiguration with the flag uploadWhileRecording to true.

func viewDidLoad() {
//...
vkRecorder.videoConfiguration.uploadWhileRecording = true
//...
}

Please note that uploadWhileRecording disables multiple clip recordings (vkRecorder.videoConfiguration.recordMultipleClips = false), meaning you are not able to rearrange and edit your clips. This is due to the fact that the recording gets uploaded to our servers immediately after you start your recording. Pausing and resuming the recording then writes into the same video clip/file.

While Recording

During recording, the video is in an initialized state:

{
"id": "0ee56b31-ce64-4b6b-835e-50adfa8165b3",
"lat": 0,
"lng": 0,
"tags": [],
"title": "",
"shotOn": "2020-11-23T18:48:34.323Z",
"metadata": {
"recorder": "VideoKitRecorder 1.0"
},
"state": "init",
"identity": "dennis",
"createdAt": "2020-11-23T18:48:37.481Z"
}

Instantly available

Right after the recording is finished, your video is already available for playback on other devices:

VKVideos.shared.getVideos(ids: ["0ee56b31-ce64-4b6b-835e-50adfa8165b3"]) { (videos: [VKVideo]?, error: Error?) in
if (error != nil) {
// Handle error
}
else if let video = videos.first {
// play video
}
}

Result:

{
"id": "0ee56b31-ce64-4b6b-835e-50adfa8165b3",
"lat": 0,
"lng": 0,
"tags": [],
"title": "",
"shotOn": "2020-11-23T18:48:34.323Z",
"metadata": {
"recorder": "VideoKitRecorder 1.0"
},
"mp4Url": {
"720p": "https://storage.video.io/accounts/2iTlgCHpxqWRCMKXdRd7/apps/52NpMpZozp7plOkgOTQV/videos/0ee56b31-ce64-4b6b-835e-50adfa8165b3/origin.mp4"
},
"state": "processing",
"identity": "dennis",
"createdAt": "2020-11-23T18:48:37.481Z",
"updatedAt": "2020-11-23T18:49:04.704Z",
"input": {
"width": 1072,
"height": 1920
},
"playable": true
}

After the transcoding process is finished after a few seconds, the video is fully processed and available in different resolutions:

{
"id": "0ee56b31-ce64-4b6b-835e-50adfa8165b3",
"lat": 0,
"lng": 0,
"tags": [],
"title": "",
"shotOn": "2020-11-23T18:48:34.323Z",
"metadata": {
"recorder": "VideoKitRecorder 1.0"
},
"mp4Url": {
"720p": "https://storage.video.io/accounts/2iTlgCHpxqWRCMKXdRd7/apps/52NpMpZozp7plOkgOTQV/videos/0ee56b31-ce64-4b6b-835e-50adfa8165b3/720p.mp4",
"540p": "https://storage.video.io/accounts/2iTlgCHpxqWRCMKXdRd7/apps/52NpMpZozp7plOkgOTQV/videos/0ee56b31-ce64-4b6b-835e-50adfa8165b3/540p.mp4",
"360p": "https://storage.video.io/accounts/2iTlgCHpxqWRCMKXdRd7/apps/52NpMpZozp7plOkgOTQV/videos/0ee56b31-ce64-4b6b-835e-50adfa8165b3/360p.mp4"
},
"state": "processed",
"identity": "dennis",
"createdAt": "2020-11-23T18:48:37.481Z",
"updatedAt": "2020-11-23T18:49:19.241Z",
"height": 1920,
"width": 1072,
"thumbUrl": "https://storage.video.io/accounts/2iTlgCHpxqWRCMKXdRd7/apps/52NpMpZozp7plOkgOTQV/videos/0ee56b31-ce64-4b6b-835e-50adfa8165b3/thumb.jpg",
"input": {
"width": 1072,
"height": 1920
},
"playable": true
}