Control live streams 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 start, stop, and monitor a live stream broadcast with Wowza GoCoder™ SDK for iOS.

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.

Start streaming

Use the startStreaming method in the WowzaGoCoder class to initiate a live stream.

//Make sure streaming isn't already active
if (!self.goCoder.isStreaming)
  // Start the live stream
  [self.goCoder startStreaming:statusCallback];

Note: If you start a broadcast and get the message, "Limited Bandwidth," it means you're using a bitrate that's too large for the current network conditions. The broadcaster will start buffering frames to preserve the quality of the playback and any recordings, but this will increase playback latency. To minimize latency, try using a lower bitrate instead.

Stop streaming

Use the endStreaming method in the WowzaGoCoder class to stop a live stream.

if (self.goCoder.isStreaming)
  // Stop the live stream
  [self.goCoder endStreaming:statusCallback];

Monitor the status of the live stream

Use the statusCallback argument for the startStreaming and endStreaming methods to implement the WOWZBroadcastStatusCallback interface. This interface defines the following callbacks that are invoked for a live stream broadcast:

Property Description
WOWZBroadcastStateIdle The stream is inactive. This is the state before and after the broadcast.
WOWZBroadcastStateReady Broadcasting components are ready.
WOWZBroadcastStateBroadcasting The broadcast is streaming.

The following example shows successful state transitions as well as an error:

// Methods implemented for the WOWZBroadcastStatusCallback protocol

// A successful status transition has been reported by the GoCoder SDK  
- (void) onSuccess:(WOWZBroadcastStatus *) goCoderStatus {
    switch (goCoderStatus.state) {
  case WOWZBroadcastStateIdle:
      NSLog(@"SDK State: %@",
    "There is no active streaming broadcast session");

  case WOWZBroadcastStateReady:
      NSLog(@"SDK State: %@",
    "Broadcast components are ready");

  case WOWZBroadcastStateBroadcasting:
      NSLog(@"SDK State: %@",
    "A streaming broadcast session is running");

// If an error is reported by the GoCoder SDK, display an alert
// that contains the error details using the U/I thread
- (void) onWOWZError:(WOWZBroadcastStatus *) goCoderStatus {
    dispatch_async(dispatch_get_main_queue(), ^{
        UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Live Streaming Error"
        UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault
            handler:^(UIAlertAction * action) {}];
        [alert addAction:defaultAction];
        [self presentViewController:alert animated:YES completion:nil];

More resources