Frame Capture (HMSVideoPlugin)


You can use Camera Frame Capture Plugin to capture the current frame from the local camera in high quality. This can be useful if you want to implement a remote KYC (know-your-customer) use-case to capture high quality photos of client's documents.

Minimum Requirements

  • SDK version 0.5.1

How to capture current camera frame in high quality

  1. Create an HMSVideoPlugin array
var videoPlugins = [HMSVideoPlugin]()
  1. Create an instance of HMSFrameCapturePlugin and activate it. Then append it to videoPlugins array, like below
let frameCapturePlugin = HMSFrameCapturePlugin() frameCapturePlugin.activate() videoPlugins.append(frameCapturePlugin)
  1. Next, assign videoPlugins array to videoPlugins property of videoSettingsBuilder:
let hmsSDK = { sdk in sdk.trackSettings = { videoSettingsBuilder, audioSettingsBuilder in videoSettingsBuilder.videoPlugins = videoPlugins ... } }

That is all the setup you need to do. Now, you can call capture method on your frameCapturePlugin instance to get the current camera frame as a UIImage:

if let image = frameCapturePlugin.capture() { // show/upload/process the uiimage }

👀 To see an example iOS Local Camera Capture Plugin implementation using 100ms SDK, checkout our example project.

Have a suggestion? Recommend changes ->

Was this helpful?