WowzaGoCoder

Conforms to:
Superclass:
NSObject
Declared In:

Introduction

The WowzaGoCoder class is the primary API interface for the GoCoder SDK. It provides methods for configuring and controlling devices and streaming live video.



Methods

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

endStreaming:


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

The callback to be invoked with streaming session status updates and errors.

Discussion

Ends the active streaming session.


getCurrentBroadcastingNetworkBitrateThroughput


- (Float64) getCurrentBroadcastingNetworkBitrateThroughput; 
Discussion

The current broadcasting actual bitrate across the socket. This value is also available for listening to with NSNotifcationCenter. notification name:WOWZBroadcastBitrateNetworkThroughputUpdate , note.userInfo key: broadcastThroughputBitrate, value is Float64


permissionForType:


Parameters
type

The WowzaGoCoderPermissionType to query.

Discussion

Gets the permission status for the specified WowzaGoCoderPermissionType.


registerAudioEncoderSink:


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

An object that conforms to the WOWZAudioEncoderSink protocol.

Discussion

Registers a WOWZAudioEncoderSink object with WowzaGoCoder. WOWZAudioEncoderSink protocol methods are called when audio is being captured and/or encoded.


registerAudioSink:


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

An object that conforms to the WOWZAudioSink protocol.

Discussion

Registers a WOWZAudioSink object with WowzaGoCoder. WOWZAudioSink protocol methods are called when audio is being captured and/or encoded.


registerDataSink:eventName:


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

An object that conforms to the WOWZAudioEncoderSink protocol.

eventName

The name of the data event the client should listen for.

Discussion

Registers a WOWZDataSink object with WowzaGoCoder. WOWZDataSink protocol methods are called when video is being encoded and a data event is received from the server.


registerLicenseKey:


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

The license key.

Return Value

Nil if no error, or an NSError that describes the license validation error.

Discussion

Registers and validates the GoCoder SDK license key.


registerVideoEncoderSink:


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

An object that conforms to the WOWZVideoEncoderSink protocol.

Discussion

Registers a WOWZVideoEncoderSink object with WowzaGoCoder. WOWZVideoEncoderSink protocol methods are called when video is actively encoding.


registerVideoSink:


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

An object that conforms to the WOWZVideoSink protocol.

Discussion

Registers a WOWZVideoSink object with WowzaGoCoder. WOWZVideoSink protocol methods are called when video is being encoded.


requestPermissionForType:response:


Parameters
type

The WowzaGoCoderPermissionType for which permission is being requested.

response

The WOWZPermissionBlock to be executed after the user responds to the the device-access request.

Discussion

Requests explicit permission to use the device's camera or microphone.


sendDataEvent:eventName:params:callback:


- (void) sendDataEvent:(WOWZDataScope)scope eventName:(nonnull NSString *)eventName 
        params:(nonnull WOWZDataMap *)params callback:(nullable WOWZDataCallback)callback; 
Parameters
scope

A WOWZDataScope 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 invoked with the result of a WOWZDataScopeModule call. Should be nil for WOWZDataScopeStream.

Discussion

Sends user-defined metadata with the current broadcast stream.


sendPingRequest:


- (void) sendPingRequest:(nonnull WOWZDataCallback)callback; 
Parameters
callback

The callback to be invoked with the result of the request. For example, the responseTime property of the result parameters passed to the callback contains the response time, in milliseconds.

Discussion

Sends a ping request to the server and returns the result of the specified callback.


setLogLevel:


Parameters
level

The log level to use.

Discussion

Sets the SDK log level.


setNetworkLogLevel:


+ (void) setNetworkLogLevel:(WowzaGoCoderNetworkLogLevel)level; 
Parameters
level

The network layer log level to use.

Discussion

Deprecated

No longer used.

Sets the SDK network layer log level.


sharedInstance


+ (nullable instancetype) sharedInstance; 
Return Value

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

Discussion

Gets the WowzaGoCoder shared instance.


startStreaming:


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

The callback to be invoked with streaming session status updates and errors.

Discussion

Starts a live streaming session with a specified status callback.


startStreamingWithConfig:config:


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

The callback to be invoked with streaming session status updates and errors.

aConfig

The configuration settings for the live streaming session.

Discussion

Starts a live streaming session with a specified status callback and configuration settings.


startStreamingWithPreset:preset:


- (void) startStreamingWithPreset:(nullable id<WOWZBroadcastStatusCallback>)statusCallback 
        preset:(WOWZFrameSizePreset)aPreset; 
Parameters
statusCallback

The callback to be invoked with streaming session status updates and errors.

aPreset

The WOWZFrameSizePreset for the live streaming session.

Discussion

Starts a live streaming session with a specified status callback and WOWZFrameSizePreset preset.


unregisterAudioEncoderSink:


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

An object that conforms to the WOWZAudioEncoderSink protocol.

Discussion

Unregisters a WOWZAudioEncoderSink object from WowzaGoCoder.


unregisterAudioSink:


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

An object that conforms to the WOWZAudioSink protocol.

Discussion

Unregisters a WOWZAudioSink object from WowzaGoCoder.


unregisterDataSink:eventName:


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

An object that conforms to the WOWZDataSink protocol.

Discussion

Unregisters a WOWZDataSink object from WowzaGoCoder.


unregisterVideoEncoderSink:


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

An object that conforms to the WOWZVideoEncoderSink protocol.

Discussion

Unregisters a WOWZVideoEncoderSink object from WowzaGoCoder.


unregisterVideoSink:


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

An object that conforms to the WOWZVideoSink protocol.

Discussion

Unregisters a WOWZVideoSink object from WowzaGoCoder.


updateEncoderLimitedBitrate:


- (void) updateEncoderLimitedBitrate:(NSInteger)bitrate; 
Parameters
bitrate

The bitrate the broadcast should use in limited bandwidth conditions.

Discussion

Updates the broadcast to use a lower-bitrate encoding during limited network conditions.


updateEncoderTargetBitrate:


- (void) updateEncoderTargetBitrate:(NSInteger)bitrate; 
Parameters
bitrate

The bitrate the broadcast should use under normal network conditions.

Discussion

Updates the broadcast to use the target bitrate encoding during normal network conditions.


Typedefs

NS_ENUM
NS_ENUM
NS_ENUM
NSUInteger
WowzaGoCoderCapturePermission
WowzaGoCoderLogLevel
WowzaGoCoderPermissionType
WOWZPermissionBlock

NS_ENUM


private

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

Access to a particular capture device has been authorized by the 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

The permission types that are available in the SDK.

See Also


NS_ENUM


private

typedef NS_ENUM(NSUInteger,WowzaGoCoderLogLevel) { WowzaGoCoderLogLevelOff = 0, WowzaGoCoderLogLevelError = 1, WowzaGoCoderLogLevelDefault = 1, WowzaGoCoderLogLevelVerbose = 2, };
Constants
WowzaGoCoderLogLevelError

Generate only error logging.

WowzaGoCoderLogLevelDefault

Generate minimal log statements from the SDK.

WowzaGoCoderLogLevelVerbose

Generate detailed log statements from the SDK.

WowzaGoCoderLogLevelOff

Disable logging.

Discussion

Settings for the log level for the GoCoder SDK.

See Also


NSUInteger


private

typedef NS_ENUM(NSUInteger,WowzaGoCoderNetworkLogLevel) { WowzaGoCoderNetworkLogLevelVerbose = 1, WowzaGoCoderNetworkLogLevelDebug = 2, WowzaGoCoderNetworkLogLevelInfo = 3, WowzaGoCoderNetworkLogLevelWarn = 4, WowzaGoCoderNetworkLogLevelError = 5 } __deprecated_msg( "use WowzaGoCoderLogLevel instead");
Constants
WowzaGoCoderNetworkLogLevelVerbose

Output all log messages.

WowzaGoCoderNetworkLogLevelDebug

Log debug, informational, warning, and error messsges.

WowzaGoCoderNetworkLogLevelInfo

Log informational, warning, and error messsges.

WowzaGoCoderNetworkLogLevelWarn

Log warning and error messages.

WowzaGoCoderNetworkLogLevelError

Log error messages.

Discussion

Deprecated

No longer used.


WowzaGoCoderCapturePermission


private

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

Access to a particular capture device has been authorized by the 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 = 0, WowzaGoCoderLogLevelError = 1, WowzaGoCoderLogLevelDefault = 1, WowzaGoCoderLogLevelVerbose = 2, };
Constants
WowzaGoCoderLogLevelError

Generate only error logging.

WowzaGoCoderLogLevelDefault

Generate minimal log statements from the SDK.

WowzaGoCoderLogLevelVerbose

Generate detailed log statements from the SDK.

WowzaGoCoderLogLevelOff

Disable logging.

Discussion

Settings for the 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

The permission types that are available in the SDK.

See Also


WOWZPermissionBlock


private

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

A callback block that's 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 when streaming with audio. The default is AVAudioSessionCategoryOptionAllowBluetooth. This property must be set before starting a preview session.


cameraPreview


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

The WOWZCameraPreview object created when the cameraView is set.


cameraView


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

The view to use for the camera preview.


config


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

The audio, video, and stream configuration settings.


isStreaming


@property (nonatomic,
    readonly) BOOL isStreaming; 
Discussion

True if a live stream is broadcasting; false otherwise.


metaData


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

The stream metadata for the broadcasted stream.


status


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

The status of the current live streaming session.