ZegoExpressEngine(Publisher)

Declared in ZegoExpressEngine+Publisher.h

Includes

Public-Func Lists

Public-Func Docs

startPublishingStream:

- (void)startPublishingStream:(NSString *) streamID;

Start publishing stream.

Parameters
streamID Stream ID, a string of up to 256 characters, needs to be globally unique within the entire AppID. If in the same AppID, different users publish each stream and the stream ID is the same, which will cause the user to publish the stream failure. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. Only support numbers, English characters and '~', '!', '@', '#', '$', '', '^', '&', '*', '(', ')', '_', '+', '=', '-', ', ';', '’', ',', '.', '<', '>', '/', ''.

startPublishingStream:channel:

- (void)startPublishingStream:(NSString *) streamID channel:(ZegoPublishChannel) channel;

Start publishing stream, you can call this api to publish the another stream.

Parameters
streamID Stream ID, a string of up to 256 characters, needs to be globally unique within the entire AppID. If in the same AppID, different users publish each stream and the stream ID is the same, which will cause the user to publish the stream failure. You cannot include URL keywords, otherwise publishing stream and playing stream will fails. Only support numbers, English characters and '~', '!', '@', '#', '$', '', '^', '&', '*', '(', ')', '_', '+', '=', '-', ', ';', '’', ',', '.', '<', '>', '/', ''.
channel Publish stream channel

stopPublishingStream

- (void)stopPublishingStream:;

Stop publishing stream.

stopPublishingStream:

- (void)stopPublishingStream:(ZegoPublishChannel) channel;

Stop publishing stream of the specified channel.

Parameters
channel Publish stream channel

setStreamExtraInfo:callback:

- (void)setStreamExtraInfo:(NSString *) extraInfo callback:(ZegoPublisherSetStreamExtraInfoCallbacknullable ) callback;

Set stream extra information.

Parameters
extraInfo Stream extra information, a string of up to 1024 characters.
callback Set stream extra information execution result notification

setStreamExtraInfo:channel:callback:

- (void)setStreamExtraInfo:(NSString *) extraInfo channel:(ZegoPublishChannel) channel callback:(ZegoPublisherSetStreamExtraInfoCallbacknullable ) callback;

Set stream additional information.

startPreview:

- (void)startPreview:(nullable ZegoCanvas *) canvas;

Start/Update local preview.

Parameters
canvas The view used to display the preview image. If the view is set to nil, no preview will be made.

startPreview:channel:

- (void)startPreview:(nullable ZegoCanvas *) canvas channel:(ZegoPublishChannel) channel;

Start/Update local preview.

stopPreview

- (void)stopPreview:;

Stop local preview.

stopPreview:

- (void)stopPreview:(ZegoPublishChannel) channel;

Stop local preview.

Parameters
channel Publish stream channel

setVideoConfig:

- (void)setVideoConfig:(ZegoVideoConfig *) config;

Set up video configuration.

Parameters
config Video configuration, the SDK provides a common setting combination of resolution, frame rate and bit rate, they also can be customized.

setVideoConfig:channel:

- (void)setVideoConfig:(ZegoVideoConfig *) config channel:(ZegoPublishChannel) channel;

Set up video configuration.

setVideoMirrorMode:

- (void)setVideoMirrorMode:(ZegoVideoMirrorMode) mirrorMode;

Set mirror mode.

Parameters
mirrorMode Mirror mode for previewing or publishing the stream

setVideoMirrorMode:channel:

- (void)setVideoMirrorMode:(ZegoVideoMirrorMode) mirrorMode channel:(ZegoPublishChannel) channel;

Set mirror mode.

setAppOrientation:

- (void)setAppOrientation:(UIInterfaceOrientation) orientation;

Set the orientation of video.

Parameters
orientation Video orientation

setAppOrientation:channel:

- (void)setAppOrientation:(UIInterfaceOrientation) orientation channel:(ZegoPublishChannel) channel;

Set the orientation of the captured video.

setAudioConfig:

- (void)setAudioConfig:(ZegoAudioConfig *) config;

set audio config

Parameters
config Audio config

mutePublishStreamAudio:

- (void)mutePublishStreamAudio:(BOOL) mute;

Stop or resume sending a audio stream.

Parameters
mute Whether to stop sending audio streams, YES means that only the video stream is sent without sending the audio stream, and NO means that the audio and video streams are sent simultaneously. The default is NO.

mutePublishStreamAudio:channel:

- (void)mutePublishStreamAudio:(BOOL) mute channel:(ZegoPublishChannel) channel;

Stop or resume sending a audio stream.

mutePublishStreamVideo:

- (void)mutePublishStreamVideo:(BOOL) mute;

Stop or resume sending a video stream.

Parameters
mute Whether to stop sending video streams, YES means that only the audio stream is sent without sending the video stream, and NO means that the audio and video streams are sent at the same time. The default is NO.

mutePublishStreamVideo:channel:

- (void)mutePublishStreamVideo:(BOOL) mute channel:(ZegoPublishChannel) channel;

Stop or resume sending a video stream.

enableTrafficControl:property:

- (void)enableTrafficControl:(BOOL) enable property:(ZegoTrafficControlProperty) property;

Enable or disable traffic control.

Parameters
enable Whether to enable traffic control. The default is ture.
property Adjustable property of traffic control, bitmask format. Should be one or the combinations of [ZegoTrafficControlProperty] enumeration. [AdaptiveFPS] as default.

setMinVideoBitrateForTrafficControl:mode:

- (void)setMinVideoBitrateForTrafficControl:(int) bitrate mode:(ZegoTrafficControlMinVideoBitrateMode) mode;

Set the minimum video bitrate for traffic control.

Parameters
bitrate Minimum video bitrate (kbps)
mode Video sending mode below the minimum bitrate.

setCaptureVolume:

- (void)setCaptureVolume:(int) volume;

Set the captured volume for publishing stream.

Parameters
volume Volume percentage. The range is 0 to 100. Default value is 100.

addPublishCdnUrl:streamID:callback:

- (void)addPublishCdnUrl:(NSString *) targetURL streamID:(NSString *) streamID callback:(ZegoPublisherUpdateCdnUrlCallbacknullable ) callback;

Add URL to relay to CDN.

Parameters
targetURL CDN relay address, supported address format rtmp.
streamID Stream ID
callback The execution result notification of the relay CDN operation, and proceed to the next step according to the execution result.

removePublishCdnUrl:streamID:callback:

- (void)removePublishCdnUrl:(NSString *) targetURL streamID:(NSString *) streamID callback:(ZegoPublisherUpdateCdnUrlCallbacknullable ) callback;

Delete the URL relayed to the CDN.

Parameters
targetURL CDN relay address, supported address format rtmp, flv, hls
streamID Stream ID
callback Remove CDN relay result notifications

enablePublishDirectToCDN:config:

- (void)enablePublishDirectToCDN:(BOOL) enable config:(nullable ZegoCDNConfig *) config;

Whether to publish stream directly to CDN without passing through Zego real-time video cloud server.

Parameters
enable Whether to enable direct publish CDN, YES: enable direct publish CDN, NO: disable direct publish CDN
config CDN configuration, if nil, use Zego's background default configuration

enablePublishDirectToCDN:config:channel:

- (void)enablePublishDirectToCDN:(BOOL) enable config:(nullable ZegoCDNConfig *) config channel:(ZegoPublishChannel) channel;

Whether to publish stream directly to CDN without passing through Zego real-time video cloud server.

setPublishWatermark:isPreviewVisible:

- (void)setPublishWatermark:(nullable ZegoWatermark *) watermark isPreviewVisible:(BOOL) isPreviewVisible;

Set publish watermark.

Parameters
watermark The upper left corner of the watermark layout is the origin of the coordinate system, and the area cannot exceed the size set by the encoding resolution. If it is nil, the watermark is cancelled.
isPreviewVisible the watermark is visible on local preview

setPublishWatermark:isPreviewVisible:channel:

- (void)setPublishWatermark:(nullable ZegoWatermark *) watermark isPreviewVisible:(BOOL) isPreviewVisible channel:(ZegoPublishChannel) channel;

Set publish watermark.

sendSEI:

- (void)sendSEI:(NSData *) data;

Send SEI.

Parameters
data SEI data

sendSEI:channel:

- (void)sendSEI:(NSData *) data channel:(ZegoPublishChannel) channel;

Send SEI.

enableHardwareEncoder:

- (void)enableHardwareEncoder:(BOOL) enable;

On/off hardware encoding.

Parameters
enable Whether to enable hardware encoding, YES: enable hardware encoding, NO: disable hardware encoding

setCapturePipelineScaleMode:

- (void)setCapturePipelineScaleMode:(ZegoCapturePipelineScaleMode) mode;

set capture pipeline scale mode.