WZBroadcast

Superclass:
NSObject
Declared In:

Introduction

The WZBroadcast class is used to configure and control a live streaming broadcast. Under normal circumstances, you do not need to access this class directly unless you are extending the GoCoder SDK.



Methods

-endBroadcast:
-registerDataSink:eventName:
-sendDataEvent:eventName:params:callback:
-startBroadcast:statusCallback:
-unregisterDataSink:eventName:

endBroadcast:


- (nonnull WZStatus *) endBroadcast:(nullable id<WZStatusCallback>)statusCallback; 
Parameters
statusCallback

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

Return Value

A WZStatus object

Discussion

Stop the active live streaming broadcast


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. The WZDataSink protocol methods will be called when video encoding is active and a data event is received from the server.


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.


startBroadcast:statusCallback:


- (nonnull WZStatus *) startBroadcast:(nonnull WZStreamConfig *)config 
        statusCallback:(nullable id<WZStatusCallback>)statusCallback; 
Parameters
config

A WZStreamConfig describing the broadcast settings

statusCallback

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

Return Value

A WZStatus object

Discussion

Start a live streaming broadcast using the specified configuration


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.


Properties

audioDevice
audioEncoder
metaData
status
statusCallback
videoEncoder

audioDevice


@property (nonatomic,
    strong,
    nullable) id<WZBroadcastComponent> audioDevice; 
Discussion

An object that adopts the WZBroadcastComponent protocol that will be used as the audio capture device for this broadcast session.


audioEncoder


@property (nonatomic,
    strong,
    nullable) id<WZBroadcastComponent> audioEncoder; 
Discussion

An object that adopts the WZBroadcastComponent protocol that will be used as the audio encoder for this broadcast session.


metaData


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

The stream metadata for the broadcasted stream


status


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

The status of the broadcast


statusCallback


@property (nonatomic,
    unsafe_unretained,
    nullable) id<WZStatusCallback> statusCallback; 
Discussion

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


videoEncoder


@property (nonatomic,
    strong,
    nullable) id<WZBroadcastComponent> videoEncoder; 
Discussion

An object that adopts the WZBroadcastComponent protocol that will be used as the video encoder for this broadcast session.