Frame Capture (HMSVideoPlugin)

Introduction

You can use Camera Frame Capture Plugin to capture the current frame from the local camera in high quality.

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 = HMSSDK.build { sdk in sdk.trackSettings = HMSTrackSettings.build { 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?

1234