WowzaGoCoder

Conforms to:
Superclass:
NSObject
Declared In:

Introduction

The WowzaGoCoder class is the primary API interface for the GoCoder SDK. It provides methods for both device and streaming configuration and control



Methods

-endStreaming:
+permissionForType:
-registerAudioEncoderSink:
-registerAudioSink:
-registerDataSink:eventName:
+registerLicenseKey:
-registerVideoEncoderSink:
-registerVideoSink:
+requestPermissionForType:response:
-sendDataEvent:eventName:params:callback:
+setLogLevel:
+sharedInstance
-startStreaming:
-startStreamingWithConfig:config:
-startStreamingWithPreset:preset:
-unregisterAudioEncoderSink:
-unregisterAudioSink:
-unregisterDataSink:eventName:
-unregisterVideoEncoderSink:
-unregisterVideoSink:

endStreaming:


- (void) endStreaming:(nullable id<WZStatusCallback>)statusCallback; 
Parameters
statusCallback

A callback that will be invoked with streaming session status updates and errors.

Discussion

End the active streaming session


permissionForType:


Parameters
type

The WowzaGoCoderPermissionType to query

Discussion

Get the current permission status for a given WowzaGoCoderPermissionType


registerAudioEncoderSink:


- (void) registerAudioEncoderSink:(nonnull id<WZAudioEncoderSink>)sink; 
Parameters
sink

An object conforming to the WZAudioEncoderSink protocol

Discussion

Registers an object that conforms to the WZAudioEncoderSink protocol with WowzaGoCoder. The WZAudioEncoderSink protocol methods will be called when video encoding is active.


registerAudioSink:


- (void) registerAudioSink:(nonnull id<WZAudioSink>)sink; 
Parameters
sink

An object conforming to the WZAudioSink protocol

Discussion

Registers an object that conforms to the WZAudioSink protocol with WowzaGoCoder. the WZAudioSink protocol methods will be called when audio capture and/or encoding are active.


registerDataSink:eventName:


- (void) registerDataSink:(nonnull id<WZDataSink>)sink 
        eventName:(nonnull NSString *)eventName; 
Parameters
sink

An object conforming to the WZAudioEncoderSink protocol

eventName

The name of the data event the client wishes to listen for

Discussion

Registers an object that conforms to the WZDataSink protocol with WowzaGoCoder. The WZDataSink protocol methods will be called when video encoding is active and a data event is received from the server.


registerLicenseKey:


+ (nullable NSError *) registerLicenseKey:(nonnull NSString *)licenseKey; 
Parameters
licenseKey

The license key

Return Value

An NSError describing the license validation error, or nil if no error

Discussion

Register and validate the GoCoder SDK license key


registerVideoEncoderSink:


- (void) registerVideoEncoderSink:(nonnull id<WZVideoEncoderSink>)sink; 
Parameters
sink

An object conforming to the WZVideoEncoderSink protocol

Discussion

Registers an object that conforms to the WZVideoEncoderSink protocol with WowzaGoCoder. The WZVideoEncoderSink protocol methods will be called when video encoding is active.


registerVideoSink:


- (void) registerVideoSink:(nonnull id<WZVideoSink>)sink; 
Parameters
sink

An object conforming to the WZVideoSink protocol

Discussion

Registers an object that conforms to the WZVideoSink protocol with WowzaGoCoder. the WZVideoSink protocol methods will be called when video capture and/or encoding are active.


requestPermissionForType:response:


Parameters
type

The WowzaGoCoderPermissionType for which permission is being requested.

response

The WZPermissionBlock to be executed once the user responds to the the device access request.

Discussion

Explicitly request permission to use the camera or microphone.


sendDataEvent:eventName:params:callback:


- (void) sendDataEvent:(WZDataScope)scope eventName:(nonnull NSString *)eventName 
        params:(nonnull WZDataMap *)params callback:(nullable WZDataCallback)callback; 
Parameters
scope

A WZDataScope defining the scope of the event to be sent.

eventName

The name of the event to be sent.

params

The parameters for the event to be sent.

callback

The callback to be called with the result of a WZDataScopeModule call. Should be nil for WZDataScopeStream.

Discussion

Send user-defined metadata within the current broadcast stream.


setLogLevel:


Parameters
level

The desired log level

Discussion

Set the SDK log level


sharedInstance


+ (nullable instancetype) sharedInstance; 
Return Value

An instance of the top level GoCoder SDK API interface, or nil if licensing failed

Discussion

Get the WowzaGoCoder shared instance


startStreaming:


- (void) startStreaming:(nullable id<WZStatusCallback>)statusCallback; 
Parameters
statusCallback

A callback that will be invoked with streaming session status updates and errors.

Discussion

Starts a live streaming session


startStreamingWithConfig:config:


- (void) startStreamingWithConfig:(nullable id<WZStatusCallback>)statusCallback 
        config:(nonnull WowzaConfig *)aConfig; 
Parameters
statusCallback

A callback that will be invoked with streaming session status updates and errors.

aConfig

The configuration settings for the live streaming session.

Discussion

Starts a live streaming session


startStreamingWithPreset:preset:


- (void) startStreamingWithPreset:(nullable id<WZStatusCallback>)statusCallback 
        preset:(WZFrameSizePreset)aPreset; 
Parameters
statusCallback

A callback that will be invoked with streaming session status updates and errors.

aPreset

The WZFrameSizePreset for the live streaming session.

Discussion

Starts a live streaming session


unregisterAudioEncoderSink:


- (void) unregisterAudioEncoderSink:(nonnull id<WZAudioEncoderSink>)sink; 
Parameters
sink

An object conforming to the WZAudioEncoderSink protocol

Discussion

Unregisters an object that conforms to the WZAudioEncoderSink protocol with WowzaGoCoder.


unregisterAudioSink:


- (void) unregisterAudioSink:(nonnull id<WZAudioSink>)sink; 
Parameters
sink

An object conforming to the WZAudioSink protocol

Discussion

Unregisters an object that conforms to the WZAudioSink protocol with WowzaGoCoder.


unregisterDataSink:eventName:


- (void) unregisterDataSink:(nonnull id<WZDataSink>)sink 
        eventName:(nonnull NSString *)eventName; 
Parameters
sink

An object conforming to the WZDataSink protocol

Discussion

Unregisters an object that conforms to the WZDataSink protocol with WowzaGoCoder.


unregisterVideoEncoderSink:


- (void) unregisterVideoEncoderSink:(nonnull id<WZVideoEncoderSink>)sink; 
Parameters
sink

An object conforming to the WZVideoEncoderSink protocol

Discussion

Unregisters an object that conforms to the WZVideoEncoderSink protocol with WowzaGoCoder.


unregisterVideoSink:


- (void) unregisterVideoSink:(nonnull id<WZVideoSink>)sink; 
Parameters
sink

An object conforming to the WZVideoSink protocol

Discussion

Unregisters an object that conforms to the WZVideoSink protocol with WowzaGoCoder.


Typedefs

NS_ENUM
NS_ENUM
NS_ENUM
WowzaGoCoderCapturePermission
WowzaGoCoderLogLevel
WowzaGoCoderPermissionType
WZPermissionBlock

NS_ENUM


private

typedef NS_ENUM(NSUInteger, WowzaGoCoderLogLevel) { WowzaGoCoderLogLevelOff, WowzaGoCoderLogLevelDefault, WowzaGoCoderLogLevelVerbose };
Constants
WowzaGoCoderLogLevelOff

Disable logging.

WowzaGoCoderLogLevelDefault

Emit a minimum of log statements from the SDK.

WowzaGoCoderLogLevelVerbose

Emit a verbose amount of log statements from the SDK.

Discussion

Settings for the desired log level for the GoCoder SDK.

See Also


NS_ENUM


private

typedef NS_ENUM(NSUInteger, WowzaGoCoderCapturePermission) { WowzaGoCoderCapturePermissionAuthorized, WowzaGoCoderCapturePermissionDenied, WowzaGoCoderCapturePermissionNotDetermined };
Constants
WowzaGoCoderCapturePermissionAuthorized

Access to a particular capture device has been authorized user.

WowzaGoCoderCapturePermissionDenied

Access to a particular capture device has been denied by the user.

WowzaGoCoderCapturePermissionNotDetermined

Access to a particular capture device has yet to be determined.

Discussion

Permissions for either an audio or video capture device.

See Also


NS_ENUM


private

typedef NS_ENUM(NSUInteger, WowzaGoCoderPermissionType) { WowzaGoCoderPermissionTypeCamera, WowzaGoCoderPermissionTypeMicrophone };
Constants
WowzaGoCoderPermissionTypeCamera

The device camera permission type

WowzaGoCoderPermissionTypeMicrophone

The device microphone permission type.

Discussion

Permission types that are availble in the SDK.

See Also


WowzaGoCoderCapturePermission


private

typedef NS_ENUM(NSUInteger, WowzaGoCoderCapturePermission) { WowzaGoCoderCapturePermissionAuthorized, WowzaGoCoderCapturePermissionDenied, WowzaGoCoderCapturePermissionNotDetermined };
Constants
WowzaGoCoderCapturePermissionAuthorized

Access to a particular capture device has been authorized user.

WowzaGoCoderCapturePermissionDenied

Access to a particular capture device has been denied by the user.

WowzaGoCoderCapturePermissionNotDetermined

Access to a particular capture device has yet to be determined.

Discussion

Permissions for either an audio or video capture device.

See Also


WowzaGoCoderLogLevel


private

typedef NS_ENUM(NSUInteger, WowzaGoCoderLogLevel) { WowzaGoCoderLogLevelOff, WowzaGoCoderLogLevelDefault, WowzaGoCoderLogLevelVerbose };
Constants
WowzaGoCoderLogLevelOff

Disable logging.

WowzaGoCoderLogLevelDefault

Emit a minimum of log statements from the SDK.

WowzaGoCoderLogLevelVerbose

Emit a verbose amount of log statements from the SDK.

Discussion

Settings for the desired log level for the GoCoder SDK.

See Also


WowzaGoCoderPermissionType


private

typedef NS_ENUM(NSUInteger, WowzaGoCoderPermissionType) { WowzaGoCoderPermissionTypeCamera, WowzaGoCoderPermissionTypeMicrophone };
Constants
WowzaGoCoderPermissionTypeCamera

The device camera permission type

WowzaGoCoderPermissionTypeMicrophone

The device microphone permission type.

Discussion

Permission types that are availble in the SDK.

See Also


WZPermissionBlock


private

typedef void (^WZPermissionBlock)( WowzaGoCoderCapturePermission permission);
Discussion

A callback block that is used with requestCameraPermission and requestMicrophonePermission


Properties

audioMuted
audioSessionOptions
cameraPreview
cameraView
config
isStreaming
metaData
status

audioMuted


@property (nonatomic,
    assign,
    getter=isAudioMuted) BOOL audioMuted; 
Discussion

The muted state of the audio encoder


audioSessionOptions


@property (nonatomic,
    assign) AVAudioSessionCategoryOptions audioSessionOptions; 
Discussion

The AVAudioSessionCategoryOptions to use if streaming with audio. Default is AVAudioSessionCategoryOptionAllowBluetooth. Note that this property must be set before starting a preview session.


cameraPreview


@property (nonatomic,
    nullable,
    readonly) WZCameraPreview *cameraPreview; 
Discussion

The WZCameraPreview object (created when the cameraView is set)


cameraView


@property (nonatomic,
    nullable) UIView *cameraView; 
Discussion

The view that the caller wants to use for the camera preview


config


@property (nonatomic,
    nonnull,
    copy) WowzaConfig *config; 
Discussion

The video, audio and stream configuration settings


isStreaming


@property (nonatomic,
    readonly) BOOL isStreaming; 
Discussion

Returns true if a live streaming broadcast is active


metaData


@property (nonatomic,
    readonly,
    nullable) WZDataMap *metaData; 
Discussion

The stream metadata for the broadcasted stream


status


@property (nonatomic,
    nonnull,
    readonly) WZStatus *status; 
Discussion

Reflects the current live streaming session status