Control a camera and mic with GoCoder SDK for iOS

Wowza GoCoder is sunset and should only be used with existing Ultra-Low Latency (ULL) streams until that technology is also sunset.

Learn how to use the WOWZCamera and WowzaGoCoder classes in the Wowza GoCoder™ SDK for iOS to control cameras and microphones on a device.

Before you begin

Before adding the functionality below to an app, make sure you've set up the Wowza GoCoder SDK for your project:

  • Request a free license and download the latest version of the SDK.
  • Configure your Xcode project to use the SDK.

See Download and install GoCoder SDK for iOS for detailed instructions.

Control a camera

The WOWZCamera class controls the capabilities that vary between the device's two cameras.

Determine camera capabilities

Use these WOWZCamera methods to identify the capabilities supported by a particular camera:

Method Description
FrameSizes Returns an array of the supported frame sizes.
hasTorch Returns true if a camera has a torch, or flash.
supportsFocusMode:WOWZCameraFocusModeLocked Returns true if the camera can lock the focus to the current lens position.
supportsFocusMode:WOWZCameraFocusModeAuto Returns true if the camera can auto-focus on a specified point location.
supportsFocusMode:WOWZCameraFocusModeContinuous Returns  true if the camera can continuously adjust the focus.
supportsFocusMode:WOWZCameraExposureModeLocked Returns true if the camera can lock the exposure to its current value.
supportsFocusMode:WOWZCameraExposureModeAuto Returns true if the camera can automatically adjust and lock the exposure to a specified value.
supportsFocusMode:WOWZCameraExposureModeContinuous Returns true if the camera can automatically adjust the exposure as needed.

The following example uses the hasTorch method:

// Enable the torch button if the current camera has a flash, or torch
self.torchButton.enabled = [ hasTorch];

Control a camera flash

Use the torchOn property to turn the flash on and off.

// Turn the flash on if it is off
if (! = YES;

Control a microphone

Use the audioMuted property of the WowzaGoCoder class to mute or pause audio while streaming.

// Mute the audio stream if it isn't already
if (!self.goCoder.audioMuted)
  self.goCoder.audioMuted = newMutedState;

More resources