AlivcLivePusher v7.1.0
Aliyun Live Pusher API Reference Manual for iOS Platforms
Loading...
Searching...
No Matches
AlivcLivePusher Class Reference

#include "AlivcLivePusher.h"

Inheritance diagram for AlivcLivePusher:

Instance Methods

(int) - addDynamicWaterMarkImageDataWithPath:x:y:w:h:
 Add animated stickers.
 
(int) - addExternalAudioStream:
 add external audio stream
 
(int) - addMixAudio:format:audioSample:
 Add audio stream mixing settings.
 
(int) - addMixVideo:width:height:rotation:displayX:displayY:displayW:displayH:adjustHeight:
 Add video stream mixing settings.
 
(int) - addWatermarkWithPath:watermarkCoordX:watermarkCoordY:watermarkWidth:
 Add watermarks.
 
(void) - changeMixVideoPosition:displayX:displayY:displayW:displayH:
 Modify the position of the mixed video stream.
 
(void) - destory
 Destroys the live pusher engine.
 
(int) - enableAudioFrameObserver:audioSource:config:
 
(int) - enableAudioVolumeIndication:smooth:reportVad:
 
(int) - enableLocalCamera:
 Disable or enable local video capture.
 
(int) - enableSEIVideoStream:
 
(int) - enableSpeakerphone:
 Set the headset or speaker as the audio output device.
 
(int) - focusCameraAtAdjustedPoint:autoFocus:
 Configure focus.
 
(int) - getAudioEffectPlayoutVolumeWithSoundId:
 Get the local playback volume of audio effects.
 
(int) - getAudioEffectPublishVolumeWithSoundId:
 Get the audio effect push mixing volume.
 
(int) - getBGMCurrentPosition
 Get the music file playback progress, in milliseconds.
 
(int) - getBGMDuration
 Get the duration of the music file, in milliseconds.
 
(AlivcLiveVideoCodecManufacturer) - getCurrentEncoderManufacturer:
 
(float) - getCurrentExposure
 Query the current exposure level.
 
(float) - getCurrentZoom
 Query the current zoom value.
 
(AlivcLivePushStatsInfo *) - getLivePushStatusInfo
 Query the statistics on live pusher.
 
(AlivcLivePushStatus) - getLiveStatus
 Query the live push status.
 
(float) - getMaxZoom
 Query the maximum zoom value that is supported.
 
(NSString *) - getParameter:
 
(NSString *) - getPushURL
 Query the push URL.
 
(float) - getSupportedMaxExposure
 Query the maximum exposure level that is supported.
 
(float) - getSupportedMinExposure
 Query the minimum exposure level that is supported.
 
(AlivcLivePushVideoEncoderModeHardCodec) - getVideoCodecType
 Get the current video encoding format.
 
(instancetype) - initWithConfig:
 Create a live pusher engine.
 
(bool) - inputMixAudioData:data:size:pts:
 Import audio stream mixing data.
 
(void) - inputMixVideoData:data:width:height:stride:size:pts:rotation:
 Import video stream mixing data.
 
(BOOL) - isCameraAutoFocusFaceModeSupported
 Does the camera support face focusing?
 
(BOOL) - isEnableSpeakerphone
 Query whether the current audio output device is the headset or the speaker.
 
(BOOL) - isPushing
 Query whether the stream is pushing.
 
(int) - muteLocalCamera:
 Specify whether to disable video capture from the camera.
 
(int) - pause
 Pause stream push from the camera,If you have specified an image by using the pauseImg parameter of the pushConfig class, the specified image is pushed.
 
(int) - pauseAllAudioEffects
 Pause all audio effects.
 
(int) - pauseAudioEffectWithSoundId:
 Pause specified audio effect files.
 
(int) - pauseBGM
 Pause the playback of background music.
 
(int) - playAudioEffectWithSoundId:filePath:config:
 Start playing audio effects.
 
(int) - preloadAudioEffectWithSoundId:filePath:
 Preload audio effect files.
 
(int) - pushExternalAudioStream:rawData:
 Input external audio stream data.
 
(int) - pushExternalVideoFrame:sourceType:
 input video raw data
 
(int) - reconnectPushAsync
 Reconnect.
 
(int) - reconnectPushAsync:
 Reconnect the push URL.
 
(int) - refreshPushURLToken:
 Refresh the authentication information, pass in a new streaming URL, including token information that has not expired, and the room ID/user ID/sdkAppId need to be the same as before.
 
(void) - registerVideoSampleObserver
 
(void) - removeDynamicWaterMark:
 Remove an animated sticker.
 
(int) - removeExternalAudioStream:
 Remove external audio stream.
 
(void) - removeMixAudio:
 Delete audio stream mixing settings.
 
(void) - removeMixVideo:
 Delete video stream mixing settings.
 
(int) - restartPush
 Restart stream push.
 
(int) - restartPushAsync
 Restart stream push.
 
(int) - resume
 Resume stream push from the camera.
 
(int) - resumeAllAudioEffects
 Resume all audio effect files.
 
(int) - resumeAsync
 Resume stream push.
 
(int) - resumeAudioEffectWithSoundId:
 Resume specified audio effect files.
 
(int) - resumeBGM
 Resume the playback of background music.
 
(void) - sendAudioSampleBuffer:withType:
 Send custom audio SampleBuffer.
 
(int) - sendDataChannelMessage:
 
(int) - sendMessage:repeatCount:delayTime:KeyFrameOnly:
 Set a custom SEI message.
 
(int) - sendMessage:repeatCount:delayTime:KeyFrameOnly:payloadType:
 Set a custom SEI message.
 
(void) - sendPCMData:size:sampleRate:channel:pts:
 Send custom audio data.
 
(void) - sendVideoData:width:height:size:pts:rotation:
 Send custom video data.
 
(void) - sendVideoSampleBuffer:
 Send custom video SampleBuffer.
 
(int) - setAllAudioEffectsPlayoutVolume:
 Set the local playback volume of all audio effects.
 
(int) - setAllAudioEffectsPublishVolume:
 Set the mixing volume of all audio effects push streaming.
 
(int) - setAudioDenoise:
 Specify whether to enable noise reduction.
 
(int) - setAudioEffectBeautifyMode:
 Set the sound mode.
 
(int) - setAudioEffectEqualizationParam:gain:
 
(int) - setAudioEffectPitchValue:
 Set audio pitch parameters.
 
(int) - setAudioEffectPlayoutVolumeWithSoundId:volume:
 Set the local playback volume of audio effects.
 
(int) - setAudioEffectPublishVolumeWithSoundId:volume:
 Set audio effect push mixing volume.
 
(int) - setAudioEffectReverbMode:
 Set the reverberation mode.
 
(int) - setAudioEffectReverbParamType:value:
 Set the reverb audio effect type.
 
(int) - setAudioEffectVoiceChangeMode:
 Set the voice change mode.
 
(int) - setAudioProfile:
 set audio profile
 
(void) - setAudioSampleDelegate:
 Set the callback for raw audio data.
 
(int) - setAutoFocus:
 Specify whether to enable autofocus.
 
(void) - setBGMDelegate:
 Set the callback for background music.
 
(int) - setBGMEarsBack:
 Specify whether to enable in-ear monitoring for background music.
 
(int) - setBGMLoop:
 Specify whether to enable loop playback of background music.
 
(int) - setBGMVolume:
 Set the volume of music in mixed audio.
 
(BOOL) - setCameraAutoFocusFaceModeEnabled:
 Set camera face focus.
 
(int) - setCaptureVolume:
 Set the volume of vocal in mixed audio.
 
(int) - setChannelProfile:
 
(void) - setCustomDetectorDelegate:
 Set a custom facial recognition callback.
 
(void) - setCustomFilterDelegate:
 Set a custom filter callback.
 
(int) - setCustomVideoResolution:
 
(void) - setErrorDelegate:
 Set the callback for live pusher engine errors.
 
(int) - setExposure:
 Specify the exposure level.
 
(int) - setExternalAudioSource:withSampleRate:channelsPerFrame:
 Set whether to enable external audio input source.
 
(int) - setExternalAudioStream:playoutVolume:
 Set external audio stream playback volume.
 
(int) - setExternalAudioStream:publishVolume:
 Set external audio streaming volume.
 
(int) - setExternalVideoSource:sourceType:renderMode:
 Enable external video input source.
 
(int) - setFlash:
 Specify whether to turn on the flash.
 
(void) - setInfoDelegate:
 Set the callback for live pusher engine status.
 
(int) - setLiveMixTranscodingConfig:
 Set mixed-stream transcoding parameters There may be more than one streamer in a live room, and each streamer has a separate audio and video stream However, viewers may just want to watch one stream.
 
(int) - setLogLevel:
 Set the log level.
 
(int) - setLogPath:maxPartFileSizeInKB:
 Set the log path.
 
(int) - setMinVideoBitrate:
 Specify the minimum bitrate.
 
(int) - setMixedWithMic:
 Set whether to mix audio collected with the microphone.
 
(void) - setMixVideoMirror:isMirror:
 Modify the mirroring settings for the mixed video stream.
 
(void) - setMute:
 Mute the audio stream.
 
(void) - setMute:mode:
 Mute the audio stream.
 
(void) - setNetworkDelegate:
 Set the callback for the network status of live pusher engine.
 
(int) - setParameter:
 Set custom parameters.
 
(void) - setpreviewDisplayMode:
 Specify the preview mode.
 
(void) - setPreviewMirror:
 Specify whether to enable the mirroring mode for preview.
 
(void) - setPushMirror:
 Specify whether to enable the mirroring mode for live pusher.
 
(int) - setQualityMode:
 Specify the quality mode.
 
(void) - setResolution:
 Specify the resolution, which takes effect only in preview mode.
 
(void) - setSnapshotDelegate:
 Set the callback for snapshot capture.
 
(int) - setTargetVideoBitrate:
 Specify the target bitrate.
 
(void) - setVideoEncoderConfiguration:
 Set the camera stream video encoding properties.
 
(int) - setVideoMirrorMode:
 Set up preview and pushing mirror.
 
(void) - setWatermark:rect:
 
(void) - setWatermarkVisible:
 Specify whether to show or hide watermarks.
 
(int) - setZoom:
 Configure zoom.
 
(void) - snapshot:interval:
 Configure snapshot settings.
 
(void) - startAudioCapture:
 Start microphone capture.
 
(void) - startAudioPlayer
 Enable audio playback.
 
(int) - startBGMWithMusicPathAsync:
 Play background music.
 
(int) - startBGMWithMusicPathAsync:config:
 Play background music.
 
(int) - startIntelligentDenoise
 Enable intelligent noise reduction.
 
(int) - startLastmileDetect:
 Start network quality detection.
 
(int) - startLocalDualAudioStream
 Enable the second audio stream push.
 
(int) - startPreview:
 Start preview.
 
(int) - startPreviewAsync:
 Start preview.
 
(int) - startPushWithURL:
 Start stream push.
 
(int) - startPushWithURLAsync:
 Start stream push.
 
(BOOL) - startRecording:
 Enable local media recording.
 
(int) - startScreenCapture:
 Start screen sharing.
 
(int) - startScreenShare
 Start screen share.
 
(int) - stopAllAudioEffects
 Stop playing all audio effect.
 
(void) - stopAudioCapture
 Stop microphone capture.
 
(int) - stopAudioEffectWithSoundId:
 Stop playing audio effects.
 
(void) - stopAudioPlayer
 Turn off audio playback.
 
(int) - stopBGMAsync
 Stop the playback of background music.
 
(int) - stopIntelligentDenoise
 Disable intelligent noise reduction.
 
(int) - stopLastmileDetect
 Stop network quality detection.
 
(int) - stopLocalDualAudioStream
 Stop pushing the second audio stream.
 
(int) - stopPreview
 Stop preview.
 
(int) - stopPush
 Stop stream push.
 
(void) - stopRecording
 Stoplocal media recording.
 
(int) - stopScreenShare
 stop screen share
 
(int) - switchCamera
 Switch between the front and rear cameras.
 
(int) - unloadAudioEffectWithSoundId:
 Delete preloaded audio effect files.
 
(void) - unregisterVideoSampleObserver
 
(void) - updateLocalView:
 Update local camera preview.
 

Class Methods

("Use AlivcLiveBase->getSDKVersion instead.") + __deprecated_msg
 Query the version number of the SDK.
 
(void) + hideDebugView
 Hide the debugging window.
 
(void) + showDebugView
 Show the debugging window.
 

Method Documentation

◆ __deprecated_msg

+ ("Use AlivcLiveBase->getSDKVersion instead.") __deprecated_msg

Query the version number of the SDK.

Returns
The version number

◆ addDynamicWaterMarkImageDataWithPath:x:y:w:h:

- (int) addDynamicWaterMarkImageDataWithPath: (NSString *) waterMarkDirPath
x: (float) x
y: (float) y
w: (float) w
h: (float) h 

Add animated stickers.

You can add up to five animated stickers.

Parameters
waterMarkDirPath:Thesequence path of the animated sticker.
Theposition x of the display screen.(0~1.0f)
Theposition y of the display screen.(0~1.0f)
Thewidth of the display screen
Theheight of the display screen
Note
Note: The SDK allows you to add animated stickers when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.
Returns
The ID of the animated sticker is returned. If you want to delete this animated sticker, specify this ID in the corresponding request.

◆ addExternalAudioStream:

- (int) addExternalAudioStream: (AliLiveExternalAudioStreamConfig *_Nonnull) config

add external audio stream

Parameters
configexternal audio stream configuration
Returns
  • <=0: failed;
  • >0: success;
  • The return value is the external audio stream Id.
Note
Input custom data to the SDK through the pushExternalAudioStream interface

◆ addMixAudio:format:audioSample:

- (int) addMixAudio: (int) channels
format: (int) format
audioSample: (int) audioSample 

Add audio stream mixing settings.

Parameters
channelsThe number of sound channels
formatThe format of the audio AlivcLivePushAudioFormat
audioSampleThe audio sample rate
Returns
The ID of the mixed audio stream is returned Note: The SDK allows you to add audio stream mixing settings when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ addMixVideo:width:height:rotation:displayX:displayY:displayW:displayH:adjustHeight:

- (int) addMixVideo: (int) format
width: (int) width
height: (int) height
rotation: (int) rotation
displayX: (float) displayX
displayY: (float) displayY
displayW: (float) displayW
displayH: (float) displayH
adjustHeight: (bool) adjustHeight 

Add video stream mixing settings.

Parameters
formatThe format of the raw video data
widthThe width of the video
heightThe height of the video
rotationThe angle of the video
displayXThe coordinate value along the x-axis to place the video in the upper-left corner.
displayYThe coordinate value along the y-axis to place the video in the upper-left corner.
displayWThe display width of the video
displayHThe display height of the video
adjustHeightThe adaptive height of the video
Returns
The ID of the mixed video stream
Note
Note: The SDK allows you to add video stream mixing settings when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ addWatermarkWithPath:watermarkCoordX:watermarkCoordY:watermarkWidth:

- (int) addWatermarkWithPath: (NSString *) path
watermarkCoordX: (CGFloat) coordX
watermarkCoordY: (CGFloat) coordY
watermarkWidth: (CGFloat) width 

Add watermarks.

You can add up to three watermarks

Parameters
pathThe path of the watermark
coordXThe coordinate of the watermark along the x-axis relative to the vertex in the upper-left corner
coordYThe coordinate of the watermark along the y-axis relative to the vertex in the upper-left corner
widthThe relative width of the watermark. (The watermark is proportionally scaled based on the actual width of the watermark image.) (0,1]
Returns
0:success != 0:failure
Note
Note: The SDK allows you to add watermarks when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ changeMixVideoPosition:displayX:displayY:displayW:displayH:

- (void) changeMixVideoPosition: (int) handler
displayX: (float) displayX
displayY: (float) displayY
displayW: (float) displayW
displayH: (float) displayH 

Modify the position of the mixed video stream.

Parameters
handlerThe ID of the mixed video stream. You can obtain the ID from the addMixVideo request
displayXThe coordinate value along the x-axis to place the video in the upper-left corner.
displayYThe coordinate value along the y-axis to place the video in the upper-left corner.
displayWThe display width of the video
displayHThedisplay height of the video
Note
Note: The SDK allows you to modify the position of the mixed video stream when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ destory

- (void) destory

Destroys the live pusher engine.

◆ enableAudioFrameObserver:audioSource:config:

- (int) enableAudioFrameObserver: (bool) enable
audioSource: (AliLiveAudioSource) audioSource
config: (AliLiveAudioFrameObserverConfig *_Nullable) config 

◆ enableAudioVolumeIndication:smooth:reportVad:

- (int) enableAudioVolumeIndication: (int) interval
smooth: (int) smooth
reportVad: (int) reportVad 

◆ enableLocalCamera:

- (int) enableLocalCamera: (BOOL) enabled

Disable or enable local video capture.

Parameters
enabled
  • YES : Enable local video capture
  • NO : Disable local video capture
Returns
  • 0 : Success
  • < 0 : Failure
Note
Camera capture will be turned off

◆ enableSEIVideoStream:

- (int) enableSEIVideoStream: (bool) enable

◆ enableSpeakerphone:

- (int) enableSpeakerphone: (BOOL) enable

Set the headset or speaker as the audio output device.

Parameters
enableYES: (Default) Speaker; NO:Headset
Returns
0:success != 0:failure

◆ focusCameraAtAdjustedPoint:autoFocus:

- (int) focusCameraAtAdjustedPoint: (CGPoint) point
autoFocus: (bool) autoFocus 

Configure focus.

Parameters
pointThe focus point The values ​​of point.x and point.y are (0,1), indicating the relative position of the current point relative to the rendering view
autoFocusWhether to enable autofocus
Returns
0:success != 0:failure

◆ getAudioEffectPlayoutVolumeWithSoundId:

- (int) getAudioEffectPlayoutVolumeWithSoundId: (NSInteger) soundId

Get the local playback volume of audio effects.

Parameters
soundIdThe ID assigned by the user to the audio effect file
Returns
  • [0, 100]:audio effect push mixing volume
  • Other: error value
Note
The valid range of audio effect push mixing volume is: [0, 100]. This method needs to be called after playAudioEffectWithSoundId:filePath:config:

◆ getAudioEffectPublishVolumeWithSoundId:

- (int) getAudioEffectPublishVolumeWithSoundId: (NSInteger) soundId

Get the audio effect push mixing volume.

Parameters
soundIdThe ID assigned by the user to the audio effect file
Returns
  • [0, 100]:audio effect push mixing volume
  • Other: error value
Note
The valid range of audio effect push mixing volume is: [0, 100]. This method needs to be called after playAudioEffectWithSoundId:filePath:config:

◆ getBGMCurrentPosition

- (int) getBGMCurrentPosition

Get the music file playback progress, in milliseconds.

Returns
  • >=0: Music file playback progress
  • <0: Return error code

◆ getBGMDuration

- (int) getBGMDuration

Get the duration of the music file, in milliseconds.

Returns
  • >=0: Music file duration
  • <0: Return error code

◆ getCurrentEncoderManufacturer:

- (AlivcLiveVideoCodecManufacturer) getCurrentEncoderManufacturer: (BOOL) isCameraStreem

◆ getCurrentExposure

- (float) getCurrentExposure

Query the current exposure level.

Returns
The exposure level

◆ getCurrentZoom

- (float) getCurrentZoom

Query the current zoom value.

Returns
The current zoom value

◆ getLivePushStatusInfo

- (AlivcLivePushStatsInfo *) getLivePushStatusInfo

Query the statistics on live pusher.

Returns
The stream data. AlivcLivePushStatsInfo

◆ getLiveStatus

- (AlivcLivePushStatus) getLiveStatus

Query the live push status.

Returns
The live push status.

◆ getMaxZoom

- (float) getMaxZoom

Query the maximum zoom value that is supported.

Returns
The maximum zoom value

◆ getParameter:

- (NSString *) getParameter: (NSString *) param

◆ getPushURL

- (NSString *) getPushURL

Query the push URL.

Returns
The push URL

◆ getSupportedMaxExposure

- (float) getSupportedMaxExposure

Query the maximum exposure level that is supported.

Returns
The maximum exposure level

◆ getSupportedMinExposure

- (float) getSupportedMinExposure

Query the minimum exposure level that is supported.

Returns
The minimum exposure level

◆ getVideoCodecType

- (AlivcLivePushVideoEncoderModeHardCodec) getVideoCodecType

Get the current video encoding format.

Returns
  • AlivcLivePushVideoEncoderModeHardCodecH264: H264
  • AlivcLivePushVideoEncoderModeHardCodecHEVC: HEVC

◆ hideDebugView

+ (void) hideDebugView

Hide the debugging window.

Deprecated

◆ initWithConfig:

- (instancetype) initWithConfig: (AlivcLivePushConfig *) config

Create a live pusher engine.

Parameters
configConfigure live pusher AlivcLivePushConfig
Returns
self:success nil:failure
Note
You can create only one primary live pusher engine,The corresponding interface for engine destruction: AlivcLivePusher::destroy

◆ inputMixAudioData:data:size:pts:

- (bool) inputMixAudioData: (int) handler
data: (long) dataptr
size: (int) size
pts: (long) pts 

Import audio stream mixing data.

Parameters
handlerThe ID of the mixed audio stream. You can obtain the ID from the addMixAudio request
dataptrThe address of the data buffer
sizeThe size of the audio data
ptsThe presentation timestamp. Unit: microsecond
Returns
success:true, failed:false
Note
Note: The SDK allows you to import audio stream mixing data when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ inputMixVideoData:data:width:height:stride:size:pts:rotation:

- (void) inputMixVideoData: (int) handler
data: (long) dataptr
width: (int) width
height: (int) height
stride: (int) stride
size: (int) size
pts: (long) pts
rotation: (int) rotation 

Import video stream mixing data.

Parameters
handlerThe ID of the mixed video stream. You can obtain the ID from the addMixVideo request
dataptrThe address of the data buffer
widthThe width of the video
heightThe height of the video
stridestride
sizeThe space occupied by each row of pixels in memory when the video is stored
ptsThe presentation timestamp. Unit: microsecond
rotationTheangle of the video
Note
Note: The SDK allows you to import video stream mixing data when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode

◆ isCameraAutoFocusFaceModeSupported

- (BOOL) isCameraAutoFocusFaceModeSupported

Does the camera support face focusing?

Note
Return NO if the camera is not open, and return YES if the current camera supports both face recognition and focus functions if the camera is open
Returns
  • YES: success
  • NO: failure

◆ isEnableSpeakerphone

- (BOOL) isEnableSpeakerphone

Query whether the current audio output device is the headset or the speaker.

Returns
- YES: Speaker;- NO: Headset

◆ isPushing

- (BOOL) isPushing

Query whether the stream is pushing.

Returns
YES:pushing NO:not pushing

◆ muteLocalCamera:

- (int) muteLocalCamera: (BOOL) mute

Specify whether to disable video capture from the camera.

(This method is not supported in basic mode.)

Parameters
muteYES No video data is sent from the camera.;NO Video data is sent from the camera.
Returns
0:success != 0:failure

◆ pause

- (int) pause

Pause stream push from the camera,If you have specified an image by using the pauseImg parameter of the pushConfig class, the specified image is pushed.

Returns
0:success != 0:failure
Note
The SDK does not provide an interface for pausing streaming. The meaning of this interface is to pause the camera streaming and switch to pushing static pictures. Only the video picture changes, and the sound is still pushed.

◆ pauseAllAudioEffects

- (int) pauseAllAudioEffects

Pause all audio effects.

Returns
  • 0:success
  • !=0:failure

◆ pauseAudioEffectWithSoundId:

- (int) pauseAudioEffectWithSoundId: (NSInteger) soundId

Pause specified audio effect files.

Parameters
soundIdThe ID assigned by the user to the audio effect file
Returns
  • 0:success
  • !=0:failure

◆ pauseBGM

- (int) pauseBGM

Pause the playback of background music.

Returns
0:success != 0:failure

◆ playAudioEffectWithSoundId:filePath:config:

- (int) playAudioEffectWithSoundId: (NSInteger) soundId
filePath: (NSString *_Nonnull) filePath
config: (AliLiveAudioEffectConfig *_Nonnull) config 

Start playing audio effects.

Start playing the audio effect interface. You can call this method multiple times to pass in different soundId and filePath to play multiple audio effect files at the same time. After the audio effect file is played, the SDK will trigger the onAudioEffectFinished: callback.

Parameters
soundIdThe ID assigned by the user to the audio effect file. Each audio effect has a unique ID. If you have loaded the audio effect into memory through preloadAudioEffectWithSoundId:filePath:, make sure the soundId here is set with preloadAudioEffectWithSoundId:filePath: The soundId is the same
filePathFile path, supports local files and network URLs
configAudio effect playback configuration, see AliLiveAudioEffectConfig for details
Returns
  • 0:success
  • !=0:failure

◆ preloadAudioEffectWithSoundId:filePath:

- (int) preloadAudioEffectWithSoundId: (NSInteger) soundId
filePath: (NSString *_Nonnull) filePath 

Preload audio effect files.

Parameters
soundIdThe ID assigned by the user to the audio effect file
filePathaudio effect file path, supports local files and network URLs
Returns
  • 0:success
  • 非0:failure
Note
The audio effect related interface is a synchronous interface. It is recommended to use local files.

◆ pushExternalAudioStream:rawData:

- (int) pushExternalAudioStream: (int) streamId
rawData: (AlivcLivePusherAudioDataSample *_Nonnull) audioFrame 

Input external audio stream data.

Parameters
streamIdexternal audio stream ID(addExternalAudioStream return)
audioFrameaudio data
Returns
  • <0:failed;
  • 0:success;
  • When the return value is 0x01070101, you need to retry delivery after the interval of data delivery time.
Note
In order to ensure voice continuity, there will be a buffer buffer inside the SDK to buffer the audio data sent in. Taking 10ms of data sent each time as an example, if 0x01070101 is returned, it means that the internal buffer is full. It is recommended to wait for 20ms before resending the current data frame;

◆ pushExternalVideoFrame:sourceType:

- (int) pushExternalVideoFrame: (AlivcLiveVideoDataSample *_Nonnull) frame
sourceType: (AliLiveVideoSource) type 

input video raw data

Parameters
framevideo raw data,see AlivcLiveVideoDataSample
typestream type,see AliLiveVideoSource
  • AliLiveVideosourceCameraType external input video data goes through the camera stream channel
  • AliLiveVideosourceScreenShareType external input video data goes through the screen stream channel
Returns
0:success != 0:failure
Note
If the return value is 0x01070102, it means that the current buffer queue is full and you need to wait before continuing to transmit data.

◆ reconnectPushAsync

- (int) reconnectPushAsync

Reconnect.

(This is an asynchronous method.)

Returns
0:success != 0:failure

◆ reconnectPushAsync:

- (int) reconnectPushAsync: (NSString *) pushURL

Reconnect the push URL.

(This is an asynchronous method.)

Returns
0:success != 0:failure

◆ refreshPushURLToken:

- (int) refreshPushURLToken: (NSString *_Nonnull) pushUrl

Refresh the authentication information, pass in a new streaming URL, including token information that has not expired, and the room ID/user ID/sdkAppId need to be the same as before.

This method is used to update the token information in the push URL of the authentication information, mainly to prevent the authentication from expiring and causing the push to fail. When we receive the onPushURLTokenWillExpire callback, the application should update the authentication information

Parameters
pushURLpush URL
Returns
0:success != 0:failure

◆ registerVideoSampleObserver

- (void) registerVideoSampleObserver

◆ removeDynamicWaterMark:

- (void) removeDynamicWaterMark: (int) vid

Remove an animated sticker.

Parameters
vid:Theanimated sticker id,addDynamicWaterMarkImageDataWithPath return

◆ removeExternalAudioStream:

- (int) removeExternalAudioStream: (int) streamId

Remove external audio stream.

Parameters
streamIdexternal audio stream ID
Returns
  • <0:failed;
  • 0:success;

◆ removeMixAudio:

- (void) removeMixAudio: (int) handler

Delete audio stream mixing settings.

Parameters
handlerThe ID of the mixed audio stream. You can obtain the ID from the addMixAudio request
Note
Note: The SDK allows you to delete audio stream mixing settings when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ removeMixVideo:

- (void) removeMixVideo: (int) handler

Delete video stream mixing settings.

Parameters
handlerThe ID of the mixed video stream. You can obtain the ID from the addMixVideo request.

◆ restartPush

- (int) restartPush

Restart stream push.

(This is a synchronous method.)

Returns
0:success != 0:failure
Note
This interface SDK will stop previewing and then start previewing, and the preview screen will go black for a while; if you do not want to preview again and just push the stream again, you can first call stopPush to end the push, and then call startPushWithURL to start the push.

◆ restartPushAsync

- (int) restartPushAsync

Restart stream push.

(This is an asynchronous method.)

Returns
0:success != 0:failure
Note
This interface SDK will stop previewing and then start previewing, and the preview screen will go black for a while; if you do not want to preview again and just push the stream again, you can first call stopPush to end the push, and then call startPushWithURLAsync to start the push.

◆ resume

- (int) resume

Resume stream push from the camera.

(This is a synchronous method.)

Returns
0:success != 0:failure

◆ resumeAllAudioEffects

- (int) resumeAllAudioEffects

Resume all audio effect files.

Returns
  • 0:success
  • !=0:failure

◆ resumeAsync

- (int) resumeAsync

Resume stream push.

(This is an asynchronous method.)

Returns
0:success != 0:failure

◆ resumeAudioEffectWithSoundId:

- (int) resumeAudioEffectWithSoundId: (NSInteger) soundId

Resume specified audio effect files.

Parameters
soundIdThe ID assigned by the user to the audio effect file
Returns
  • 0:success
  • !=0:failure

◆ resumeBGM

- (int) resumeBGM

Resume the playback of background music.

Returns
0:success != 0:failure

◆ sendAudioSampleBuffer:withType:

- (void) sendAudioSampleBuffer: (CMSampleBufferRef) sampleBuffer
withType: (RPSampleBufferType) sampleBufferType 

Send custom audio SampleBuffer.

You can call this method only when you use replaykit to stream screen recordings

Parameters
sampleBufferaudio sample buffer
sampleBufferTypeaudio sample buffer type
Note
Note: The SDK allows you to send custom audio SampleBuffer when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ sendDataChannelMessage:

- (int) sendDataChannelMessage: (NSString *) message

◆ sendMessage:repeatCount:delayTime:KeyFrameOnly:

- (int) sendMessage: (NSString *) msg
repeatCount: (int) count
delayTime: (int) time
KeyFrameOnly: (bool) isKeyFrame 

Set a custom SEI message.

Parameters
msgThe message
countThe number of repetitions
timeThe latency. Unit: millisecond
isKeyFrameWhether to send only keyframes,This parameter only supports setting in livePushMode = AlivcLivePushBasicMode mode, and temporarily does not support setting in AlivcLivePushInteractiveMode mode, Pass false in interactive mode
Returns
0:success != 0:failure

◆ sendMessage:repeatCount:delayTime:KeyFrameOnly:payloadType:

- (int) sendMessage: (NSString *) msg
repeatCount: (int) count
delayTime: (int) time
KeyFrameOnly: (bool) isKeyFrame
payloadType: (int) payloadType 

Set a custom SEI message.

Parameters
msgThe message
countThe number of repetitions
timeThe latency. Unit: millisecond
isKeyFrameWhether to send only keyframes,This parameter only supports setting in livePushMode = AlivcLivePushBasicMode mode, and temporarily does not support setting in AlivcLivePushInteractiveMode mode, , Pass false in interactive mode
payloadTypepayloadType type, the settable value is 5 or the range [100..254]. If 5 is set, there will be a 16-byte UUID in front of the content.
Returns
0:success != 0:failure
Note
The current SDK only supports the livePushMode = AlivcLivePushInteractiveMode mode. Setting the payloadType in the AlivcLivePushBasicMode mode is temporarily not supported.

◆ sendPCMData:size:sampleRate:channel:pts:

- (void) sendPCMData: (char *) data
size: (int) size
sampleRate: (int) sampleRate
channel: (int) channel
pts: (uint64_t) pts 

Send custom audio data.

Parameters
dataThe audio data
sizeThe data size
sampleRateThe sample rate
channelThe number of sound channels
ptsThe presentation timestamp. Unit: microsecond

◆ sendVideoData:width:height:size:pts:rotation:

- (void) sendVideoData: (char *) data
width: (int) width
height: (int) height
size: (int) size
pts: (uint64_t) pts
rotation: (int) rotation 

Send custom video data.

Parameters
dataThe video data
widthThe width of the video
heightThe height of the video
sizeThe data size
ptsThe presentation timestamp. Unit: microsecond
rotationThe rotation degree

◆ sendVideoSampleBuffer:

- (void) sendVideoSampleBuffer: (CMSampleBufferRef) sampleBuffer

Send custom video SampleBuffer.

Parameters
sampleBuffervideo sample buffer
Note
The SDK allows you to send custom video SampleBuffer when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ setAllAudioEffectsPlayoutVolume:

- (int) setAllAudioEffectsPlayoutVolume: (NSInteger) volume

Set the local playback volume of all audio effects.

Parameters
volumeAudio effect local playback volume, range: [0, 100], default value: 50
Returns
  • 0:success
  • !=0:failure

◆ setAllAudioEffectsPublishVolume:

- (int) setAllAudioEffectsPublishVolume: (NSInteger) volume

Set the mixing volume of all audio effects push streaming.

Parameters
volumePush mix volume, range is: [0, 100], default value: 50
Returns
  • 0:success
  • !=0:failure

◆ setAudioDenoise:

- (int) setAudioDenoise: (bool) isOpen

Specify whether to enable noise reduction.

Parameters
isOpenWhether to enable noise reduction. true:Enabled false:Disabled default:true
Returns
0:success != 0:failure

◆ setAudioEffectBeautifyMode:

- (int) setAudioEffectBeautifyMode: (AliLiveAudioEffectBeautifyMode) mode

Set the sound mode.

Parameters
modesee AliLiveAudioEffectBeautifyMode
Returns
  • YES: success
  • NO: failure

◆ setAudioEffectEqualizationParam:gain:

- (int) setAudioEffectEqualizationParam: (AliLiveAudioEffectEqualizationBandFrequency) bandIndex
gain: (float) gain 

◆ setAudioEffectPitchValue:

- (int) setAudioEffectPitchValue: (double) value

Set audio pitch parameters.

Parameters
valueaudio pitch parameters,value:[0.5, 2.0],1.0 means the pitch remains unchanged, less than 1.0 means the pitch decreases, greater than 1.0 means the pitch increases, the default is 1.0
Returns
  • YES: success
  • NO: failure

◆ setAudioEffectPlayoutVolumeWithSoundId:volume:

- (int) setAudioEffectPlayoutVolumeWithSoundId: (NSInteger) soundId
volume: (NSInteger) volume 

Set the local playback volume of audio effects.

Parameters
soundIdThe ID assigned by the user to the audio effect file
volumeplayback mix volume, range is: [0, 100], default value: 50
Returns
  • 0:success
  • !=0:failure
Note
This method needs to be called after playAudioEffectWithSoundId:filePath:config:

◆ setAudioEffectPublishVolumeWithSoundId:volume:

- (int) setAudioEffectPublishVolumeWithSoundId: (NSInteger) soundId
volume: (NSInteger) volume 

Set audio effect push mixing volume.

Parameters
soundIdThe ID assigned by the user to the audio effect file
volumePush mix volume, range is: [0, 100], default value: 50
Returns
  • 0:success
  • !=0:failure
Note
This method needs to be called after playAudioEffectWithSoundId:filePath:config:

◆ setAudioEffectReverbMode:

- (int) setAudioEffectReverbMode: (AlivcLivePushAudioEffectReverbMode) mode

Set the reverberation mode.

Parameters
modeReference AlivcLivePushAudioEffectReverbMode Values that specify the reverberation effects.
Returns
0:success != 0:failure
Note
You can call this method before or during live push.

◆ setAudioEffectReverbParamType:value:

- (int) setAudioEffectReverbParamType: (AliLiveAudioEffectReverbParamType) type
value: (float) value 

Set the reverb audio effect type.

Parameters
typesee AliLiveAudioEffectReverbParamType
value
Returns
  • YES: success
  • NO: failure

◆ setAudioEffectVoiceChangeMode:

- (int) setAudioEffectVoiceChangeMode: (AlivcLivePushAudioEffectVoiceChangeMode) mode

Set the voice change mode.

Parameters
modeReference AlivcLivePushAudioEffectVoiceChangerMode Values that specify the voice change effects.
Returns
0:success != 0:failure
Note
You can call this method before or during live push.

◆ setAudioProfile:

- (int) setAudioProfile: (AlivcLiveAudioProfile) audio_profile

set audio profile

Parameters
audio_profileAudio capture/encoding mode parameters, see for details AlivcLiveAudioProfile
Returns
  • YES: success
  • NO: failure
Note
Only valid settings before startPushWithURL are supported;

◆ setAudioSampleDelegate:

- (void) setAudioSampleDelegate: (id< AlivcLivePusherAudioSampleDelegate >) delegate

Set the callback for raw audio data.

Parameters
delegateAlivcLivePusherAudioSampleDelegate

◆ setAutoFocus:

- (int) setAutoFocus: (bool) autoFocus

Specify whether to enable autofocus.

Parameters
autoFocustrue:autofocus false:Manual focus
Returns
0:success != 0:failure
Note
The SDK internal default is autofocus

◆ setBGMDelegate:

- (void) setBGMDelegate: (id< AlivcLivePusherBGMDelegate >) delegate

Set the callback for background music.

Parameters
delegateAlivcLivePusherBGMDelegate

◆ setBGMEarsBack:

- (int) setBGMEarsBack: (bool) isOpen

Specify whether to enable in-ear monitoring for background music.

Parameters
isOpenWhether to enable in-ear monitoring. true:Enabled false:Disabled
Returns
0:success != 0:failure

◆ setBGMLoop:

- (int) setBGMLoop: (bool) isLoop

Specify whether to enable loop playback of background music.

Parameters
isLoopWhether to loop. true:Loop false:No loop
Returns
0:success != 0:failure

◆ setBGMVolume:

- (int) setBGMVolume: (int) volume

Set the volume of music in mixed audio.

Parameters
volumeThe music volume.:[0 ~ 100] default:50
Returns
0:success != 0:failure

◆ setCameraAutoFocusFaceModeEnabled:

- (BOOL) setCameraAutoFocusFaceModeEnabled: (BOOL) enable

Set camera face focus.

Parameters
enableYES: open; NO:close
Returns
  • YES: success
  • NO: failure

◆ setCaptureVolume:

- (int) setCaptureVolume: (int) volume

Set the volume of vocal in mixed audio.

Parameters
volumeThe vocal volume.:[0 ~ 100] default:50
Returns
0:success != 0:failure

◆ setChannelProfile:

- (int) setChannelProfile: (AlivcLiveChannelProfile) profile

◆ setCustomDetectorDelegate:

- (void) setCustomDetectorDelegate: (id< AlivcLivePusherCustomDetectorDelegate >) delegate

Set a custom facial recognition callback.

Parameters
delegateAlivcLivePusherCustomDetectorDelegate

◆ setCustomFilterDelegate:

- (void) setCustomFilterDelegate: (id< AlivcLivePusherCustomFilterDelegate >) delegate

Set a custom filter callback.

Parameters
delegateAlivcLivePusherCustomFilterDelegate
Note
Please refer to the callbacks related to docking third-party beauty SDK.: https://help.aliyun.com/zh/live/developer-reference/handling-of-exceptions-and-special-scenarios-for-ios

◆ setCustomVideoResolution:

- (int) setCustomVideoResolution: (CGSize) videoSize

◆ setErrorDelegate:

- (void) setErrorDelegate: (id< AlivcLivePusherErrorDelegate >) delegate

Set the callback for live pusher engine errors.

Parameters
delegateAlivcLivePusherErrorDelegate
Note
error callbacks and related processing can be referred to:https://help.aliyun.com/zh/live/developer-reference/handling-of-exceptions-and-special-scenarios-for-ios

◆ setExposure:

- (int) setExposure: (float) exposure

Specify the exposure level.

Parameters
exposureThe exposure level
Returns
0:success != 0:failure

◆ setExternalAudioSource:withSampleRate:channelsPerFrame:

- (int) setExternalAudioSource: (BOOL) enable
withSampleRate: (NSUInteger) sampleRate
channelsPerFrame: (NSUInteger) channelsPerFrame 

Set whether to enable external audio input source.

Parameters
enableYES: Enable; NO: Disable
sampleRatesamplerate 16k, 48k...
channelsPerFrameChannels: 1: mono; 2:stereo
Returns
  • >=0: success
  • <0: failure

◆ setExternalAudioStream:playoutVolume:

- (int) setExternalAudioStream: (int) streamId
playoutVolume: (int) playoutVolume 

Set external audio stream playback volume.

Parameters
streamIdexternal audio stream ID
playoutVolumePlayback volume, value range [0, 100]
Returns
  • <0:failed;
  • 0:success;

◆ setExternalAudioStream:publishVolume:

- (int) setExternalAudioStream: (int) streamId
publishVolume: (int) publishVolume 

Set external audio streaming volume.

Parameters
streamIdexternal audio stream ID
publishVolumePush volume, value range [0, 100]
Returns
  • <0:failed;
  • 0:success;

◆ setExternalVideoSource:sourceType:renderMode:

- (int) setExternalVideoSource: (BOOL) enable
sourceType: (AliLiveVideoSource) type
renderMode: (AliLiveRenderMode) renderMode 

Enable external video input source.

Parameters
enable
  • YES turn on
  • NO turn off
typestream type,see AliLiveVideoSource
  • AliLiveVideoSourceCameraType external input video data goes through the camera stream channel. If the current camera collection is open, call this interface and set enable to YES, and the SDK will replace the camera collection.
  • AliLiveVideoSourceScreenShareType external input video data goes through the screen stream channel. If the current screen sharing collection is open, call this interface and set enable to YES, and the SDK will replace the screen sharing collection.
renderModerender mode. When the aspect ratio of the external input video source is inconsistent with the push profile, the corresponding rendermode will be used for processing. For details, see AliLiveRenderMode
  • AliLiveRenderModeAuto auto(default) If the aspect ratio of the externally input video is inconsistent with the aspect ratio of the push setting, the aspect ratio of the external input video is maintained and the width and height are scaled proportionally to the width and height range of the push setting. Note that in this mode, in order to ensure the original The proportion and content integrity of the video will lead to inconsistencies in the actual resolution and settings of the stream.
  • AliLiveRenderModeStretch Stretch Mode, if the aspect ratio of the external input video is inconsistent with the aspect ratio set by the push stream, the input video will be stretched to the ratio set by the push stream, and the picture will be deformed.
  • AliLiveRenderModeFill Fill black borders. If the aspect ratio of the external input video is inconsistent with the aspect ratio set by the push stream, the input video will be filled with black borders on the top, bottom or left and right.
  • AliLiveRenderModeCrop Cropping, if the aspect ratio of the external input video is inconsistent with the aspect ratio of the push setting, the width or height of the input video will be cropped, and the screen content will be lost.
Returns
0:success != 0:failure
Note
Enter custom data into the SDK through the pushExternalVideoFrame interface

◆ setFlash:

- (int) setFlash: (bool) flash

Specify whether to turn on the flash.

Parameters
flashtrue:Turn on the flash. false:Turn off the flash
Returns
0:success != 0:failure

◆ setInfoDelegate:

- (void) setInfoDelegate: (id< AlivcLivePusherInfoDelegate >) delegate

Set the callback for live pusher engine status.

Parameters
delegateAlivcLivePusherInfoDelegate

◆ setLiveMixTranscodingConfig:

- (int) setLiveMixTranscodingConfig: (AlivcLiveTranscodingConfig *) config

Set mixed-stream transcoding parameters There may be more than one streamer in a live room, and each streamer has a separate audio and video stream However, viewers may just want to watch one stream.

Therefore, you need to mix multiple audio and video streams into one standard live stream, which requires mixed-stream transcoding In co-streaming scenarios, you need to mix the audio and video streams of the streamer and co-streamer into a standard live stream for viewers to watch In battle scenarios, you need to mix the audio and video streams of multiple streamers engaging in the battle into a standard live stream for viewers to watch

Parameters
configRefer to the description about AlivcLiveTranscodingConfig in the AlivcLiveDef.h file If you pass nil to the parameter, mixed-stream transcoding is disabled
Returns
0:success != 0:failure
Note
If the streamer is still streaming but stream mixing is no longer required, be sure to pass nil to the parameter to disable mixed-stream transcoding. When the feature is enabled, the mixed-stream transcoding module continues to work, which may incur unnecessary fees for you.

◆ setLogLevel:

- (int) setLogLevel: ("Use AlivcLiveBase->setLogLevel instead.") __deprecated_msg

Set the log level.

Parameters
levelLog default:AlivcLivePushLogLevelError
Returns
0:success != 0:failure

◆ setLogPath:maxPartFileSizeInKB:

- (int) setLogPath: (NSString *) logPath
maxPartFileSizeInKB: ("Use AlivcLiveBase->setLogPath:maxPartFileSizeInKB instead.") __deprecated_msg 

Set the log path.

Parameters
logPathLog path
maxPartFileSizeInKBThe maximum size of each part. The total volume of logs is five times the maximum part size.
Returns
0:success != 0:failure

◆ setMinVideoBitrate:

- (int) setMinVideoBitrate: (int) minBitrate

Specify the minimum bitrate.

Parameters
minBitrateThe minimum bitrate. [100 5000](Kbps)
Returns
0:success != 0:failure

◆ setMixedWithMic:

- (int) setMixedWithMic: (BOOL) mixed

Set whether to mix audio collected with the microphone.

Parameters
mixedYES:mix;NO:Completely replace the microphone to collect data
Returns
  • <0:failed;
  • 0:success;

◆ setMixVideoMirror:isMirror:

- (void) setMixVideoMirror: (int) handler
isMirror: (BOOL) isMirror 

Modify the mirroring settings for the mixed video stream.

Parameters
handlerThe ID of the mixed video stream. You can obtain the ID from the addMixVideo request.
isMirrorWhether to enable mirroring
Note
Note: The SDK allows you to modify the mirroring settings for the mixed video stream when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ setMute:

- (void) setMute: (bool) mute

Mute the audio stream.

Parameters
mutetrue:mute false:Normal
Note
Call this interface to control whether the audio stream is muted; Even when muted, the system still occupies microphone permissions and sends muted audio data
If you want to no longer occupy system microphone permissions, that is, turn off audio collection, please refer to the interface:AlivcLivePusher::stopAudioCapture

◆ setMute:mode:

- (void) setMute: (BOOL) mute
mode: (AliLiveMuteLocalAudioMode) mode 

Mute the audio stream.

Parameters
mutetrue:mute false:Normal
modemute mode. There are three types of mute modes. For details, see AliLiveMuteLocalAudioMode
Note
Call this interface to control whether the audio stream is muted; Even when muted, the system still occupies microphone permissions and sends muted audio data
If you want to no longer occupy system microphone permissions, that is, turn off audio collection, please refer to the interface:AlivcLivePusher::stopAudioCapture

◆ setNetworkDelegate:

- (void) setNetworkDelegate: (id< AlivcLivePusherNetworkDelegate >) delegate

Set the callback for the network status of live pusher engine.

Parameters
delegateAlivcLivePusherNetworkDelegate
Note
For network monitoring callbacks and related processing, please refer to: https://help.aliyun.com/zh/live/developer-reference/handling-of-exceptions-and-special-scenarios-for-ios

◆ setParameter:

- (int) setParameter: (NSString *_Nonnull) param

Set custom parameters.

Parameters
paramCustom parameters
Returns
0:success != 0:failure

◆ setpreviewDisplayMode:

- (void) setpreviewDisplayMode: (AlivcPusherPreviewDisplayMode) displayMode

Specify the preview mode.

Parameters
displayModeThe preview mode

◆ setPreviewMirror:

- (void) setPreviewMirror: (bool) mirror

Specify whether to enable the mirroring mode for preview.

Parameters
mirrortrue:Enable the mirroring mode for preview. false:Disable the mirroring mode for preview.
Note
By default, the SDK mirrors the front camera preview and does not mirror the rear camera preview.

◆ setPushMirror:

- (void) setPushMirror: (bool) mirror

Specify whether to enable the mirroring mode for live pusher.

Parameters
mirrortrue:Enable the mirroring mode for stream push. false:Disable the mirroring mode for stream push
Note
SDK default push stream does not mirror

◆ setQualityMode:

- (int) setQualityMode: (AlivcLivePushQualityMode) qualityMode

Specify the quality mode.

Parameters
qualityModeIf you select the ResolutionFirst mode, the SDK prioritizes the quality of streams. If you select the FluencyFirst mode, the SDK prioritizes the smoothness of streams. This method supports only the two modes. The bitrate setting becomes invalid after you specify the quality mode.
Returns
0:success != 0:failure
Note
This interface only takes effect in basic mode and does not take effect in interactive mode.

◆ setResolution:

- (void) setResolution: (AlivcLivePushResolution) resolution

Specify the resolution, which takes effect only in preview mode.

Parameters
resolutionThe resolution of the ingested stream
Note
This interface can dynamically adjust the push resolution. For example, in a multi-player PK scenario, you can use this interface to dynamically adjust the push resolution according to the different number of people in the PK.

◆ setSnapshotDelegate:

- (void) setSnapshotDelegate: (id< AlivcLivePusherSnapshotDelegate >) delegate

Set the callback for snapshot capture.

Parameters
delegateAlivcLivePusherSnapshotDelegate

◆ setTargetVideoBitrate:

- (int) setTargetVideoBitrate: (int) targetBitrate

Specify the target bitrate.

Parameters
targetBitrateThe target bitrate [100 5000](Kbps)
Returns
0:success != 0:failure

◆ setVideoEncoderConfiguration:

- (void) setVideoEncoderConfiguration: (AliLiveVideoEncoderConfiguration *_Nonnull) config

Set the camera stream video encoding properties.

This method is used to set the video parameters corresponding to the camera stream video encoding properties, such as resolution, frame rate, bit rate, etc. All set parameters have corresponding range limits. If the set parameters are not within the valid range, the SDK will automatically adjust

Parameters
configPredefined encoding properties, see AliLiveVideoEncoderConfiguration

◆ setVideoMirrorMode:

- (int) setVideoMirrorMode: (AliLiveVideoPipelineMirrorMode) mirrorMode

Set up preview and pushing mirror.

Parameters
mirrorModemirror mode
Returns
0:success != 0:failure
Note
  • This interface can be dynamically set before and after joining the meeting. The SDK will record the status internally and operate the video when preview and encoding can be operated;
  • This interface overlaps with the mirror in setPreviewMirror & setPushMirror. You only need to use one of them when using it.

◆ setWatermark:rect:

- (void) setWatermark: (nullable UIImage *) image
rect: (CGRect) rect 

◆ setWatermarkVisible:

- (void) setWatermarkVisible: (bool) visable

Specify whether to show or hide watermarks.

Parameters
visabletrue:Show watermarks.,false:Hide watermarks.

◆ setZoom:

- (int) setZoom: (float) zoom

Configure zoom.

Parameters
zoomThe zoom value.[0:MaxZoom]
Returns
0:success != 0:failure

◆ showDebugView

+ (void) showDebugView

Show the debugging window.

Deprecated

◆ snapshot:interval:

- (void) snapshot: (int) count
interval: (int) interval 

Configure snapshot settings.

Parameters
countThe number of snapshots
intervalThe interval between snapshots
Note
lYou can specify the count and interval parameters only when livePushMode is set to AlivcLivePushBasicMode. When livePushMode is set to AlivcLivePushInteractiveMode, the count and interval parameters that you pass are not parsed. In this case, only one snapshot is captured.

◆ startAudioCapture:

- (void) startAudioCapture: (BOOL) keepAlive

Start microphone capture.

Parameters
keepAliveYES: The microphone device remains on after stopping push ;NO: The microphone device is turned off after stopping push
Note
Calling this interface to start audio capture and transmission, it will occupy system microphone permissions
stopAudioCapture, corresponding to the interface: AlivcLivePusher::stopAudioCapture
If you only need to mute without turning off audio capture, please refer to the following interfaces: AlivcLivePusher::setMute:

◆ startAudioPlayer

- (void) startAudioPlayer

Enable audio playback.

Note
This interface can control the opening of audio playback in advance. If not set, the SDK will automatically open audio playback after subscribing to the audio stream.

◆ startBGMWithMusicPathAsync:

- (int) startBGMWithMusicPathAsync: (NSString *) path

Play background music.

Parameters
pathThe path of the background music
Returns
0:success != 0:failure

◆ startBGMWithMusicPathAsync:config:

- (int) startBGMWithMusicPathAsync: (NSString *) path
config: (AlivcLiveBGMConfig *_Nonnull) config 

Play background music.

Parameters
pathThe path of the background music
configThe config of the background music
Returns
0:success != 0:failure

◆ startIntelligentDenoise

- (int) startIntelligentDenoise

Enable intelligent noise reduction.

Returns
0:success != 0:failure
  • Push SDK provides audio and video enhancement by using various components. The intelligent noise reduction feature is provided in the form of a component. You can learn about it in the ApsaraVideo Live documentation. For information about how to integrate the component into the stream ingest engine, see the following topic: https://help.aliyun.com/document_detail/600551.html
  • Before you call this method, make sure that pulginAliDenoise.framework provided by ApsaraVideo Live is integrated.
  • You can call this method to enable intelligent noise reduction during a live pushing.
  • By default, the intelligent noise reduction feature is disabled. If you enabled this feature, power consumption increases. This feature is suitable for voice communication scenarios such as conferences and educational activities, but not suitable for scenarios with background music.

◆ startLastmileDetect:

- (int) startLastmileDetect: (AliLiveNetworkQualityProbeConfig *_Nonnull) config

Start network quality detection.

Parameters
configNetwork detection configuration,AliLiveNetworkQualityProbeConfig

Network quality detection needs to be called before startPush. As a result of the detection, startLastmileDetect cannot be called after startPush

Note
In about 3s, the rough result will be called back in AlivcLivePusherNetworkDelegate::onLastmileDetectResultWithQuality:networkQuality:
Returns
0:success != 0:failure

◆ startLocalDualAudioStream

- (int) startLocalDualAudioStream

Enable the second audio stream push.

Note
After the second audio stream is turned on and pushed, you can call addExternalAudioStream to add an audio data source, and use pushExternalAudioStream to input audio data to the second audio channel.
Returns
  • 0:成功
  • 非0:失败

◆ startPreview:

- (int) startPreview: (UIView *) previewView

Start preview.

(This is a synchronous method.)

Parameters
previewViewview
Returns
0:success != 0:failure
Note
The callback corresponding to this interface:AlivcLivePusherInfoDelegate::onPreviewStarted:
Callback corresponding to successful preview:AlivcLivePusherInfoDelegate::onFirstFramePreviewed:
If you need to update the rendering View (for example, you just started preview on the A view and need to update it to render on the B view), you can call the interface: AlivcLivePusher::updateLocalView:
If you need to adjust the preview style (such as cropping, lifting), please refer to the interface settings:AlivcLivePushConfig::previewDisplayMode or AlivcLivePusher::setpreviewDisplayMode:

◆ startPreviewAsync:

- (int) startPreviewAsync: (UIView *) preview

Start preview.

(This is an asynchronous method.)

Parameters
previewview
Returns
0:success != 0:failure
Note
The callback corresponding to this interface:AlivcLivePusherInfoDelegate::onPreviewStarted:
Callback corresponding to successful preview:AlivcLivePusherInfoDelegate::onFirstFramePreviewed:
If you need to update the rendering View (for example, you just started preview on the A view and need to update it to render on the B view), you can call the interface: AlivcLivePusher::updateLocalView:
If you need to adjust the preview style (such as cropping, lifting), please refer to the interface settings:AlivcLivePushConfig::previewDisplayMode or AlivcLivePusher::setpreviewDisplayMode:

◆ startPushWithURL:

- (int) startPushWithURL: (NSString *) pushURL

Start stream push.

(This is a synchronous method.)

Parameters
pushURLpush URL
Returns
0:success != 0:failure
Note
The callbacks that can be received after calling this interface:
  1. Push connection established successfully:AlivcLivePusherInfoDelegate::onPushStarted:
  2. Callback for successful sending of the first frame of audio and video stream, which can be used as callback for successful streaming: AlivcLivePusherInfoDelegate::onFirstFramePushed:

◆ startPushWithURLAsync:

- (int) startPushWithURLAsync: (NSString *) pushURL

Start stream push.

(This is an asynchronous method.)

Parameters
pushURLpush URL
Returns
0:success != 0:failure
Note
The callbacks that can be received after calling this interface:
  1. Push connection established successfully:AlivcLivePusherInfoDelegate::onPushStarted:
  2. Callback for successful sending of the first frame of audio and video stream, which can be used as callback for successful streaming: AlivcLivePusherInfoDelegate::onFirstFramePushed:

◆ startRecording:

- (BOOL) startRecording: (AlivcLiveLocalRecoderConfig *_Nullable) config

Enable local media recording.

Note
After turning it on, record the audio and video content in the live broadcast to a local file. After calling the interface, the recording status is notified through the onMediaRecordEvent callback.
Parameters
configLocal recording parameters, see AlivcLiveLocalRecoderConfig

◆ startScreenCapture:

- (int) startScreenCapture: (NSString *) appGroup

Start screen sharing.

(This method supports iPhones and iPads that run on iOS 11.0 or later.)

This method is used with AlivcLibReplayKitExt.framework to add the AlivcLibReplayKitExt.framework library to an Extension to implement screen capture and data transmission. Audio and video data is received in the host app for stream pusher.

Parameters
appGroupApp group ID The ID of the app group to which the host app and the Extension belong. In this case, the host app and the Extension belong to the same app group. If no app group is available, you cannot call this method.
Note
ote: The SDK supports screen sharing (screen recording for stream ingest) when livePushMode is set to AlivcLivePushBasicMode, but not when livePushMode is set to AlivcLivePushInteractiveMode.

◆ startScreenShare

- (int) startScreenShare

Start screen share.

Returns
  • YES: success
  • NO: failure

◆ stopAllAudioEffects

- (int) stopAllAudioEffects

Stop playing all audio effect.

Returns
  • 0:success
  • !=0:failure

◆ stopAudioCapture

- (void) stopAudioCapture

Stop microphone capture.

Note
After calling this interface, the microphone device is closed
Call this interface to turn off audio collection, no longer occupy system microphone permissions, and no longer send audio data
If the system still shows microphone permission occupied after calling this interface, please check if it is caused by other functions
startAudioCapture, corresponding to the interface: AlivcLivePusher::startAudioCapture:
If you only need to mute without turning off audio capture, please refer to the following interfaces: AlivcLivePusher::setMute:

◆ stopAudioEffectWithSoundId:

- (int) stopAudioEffectWithSoundId: (NSInteger) soundId

Stop playing audio effects.

Parameters
soundIdThe ID assigned by the user to the audio effect file. Each audio effect has a unique ID. If you have loaded the audio effect into memory through preloadAudioEffectWithSoundId:filePath:, make sure the soundId here is set with preloadAudioEffectWithSoundId:filePath: The soundId is the same
Returns
  • 0:success
  • !=0:failure

◆ stopAudioPlayer

- (void) stopAudioPlayer

Turn off audio playback.

Note
This interface can control turning off audio playback, corresponding to startAudioPlayer

◆ stopBGMAsync

- (int) stopBGMAsync

Stop the playback of background music.

Returns
0:success != 0:failure

◆ stopIntelligentDenoise

- (int) stopIntelligentDenoise

Disable intelligent noise reduction.

Note
You can call this method to disable intelligent noise reduction during a voice call.

◆ stopLastmileDetect

- (int) stopLastmileDetect

Stop network quality detection.

Returns
0:success != 0:failure

◆ stopLocalDualAudioStream

- (int) stopLocalDualAudioStream

Stop pushing the second audio stream.

Returns
  • YES: success
  • NO: failure

◆ stopPreview

- (int) stopPreview

Stop preview.

Returns
0:success != 0:failure
Note
The callback corresponding to this interface:AlivcLivePusherInfoDelegate::onPreviewStoped:

◆ stopPush

- (int) stopPush

Stop stream push.

Returns
0:success != 0:failure
Note
The callbacks that can be received after calling this interface: AlivcLivePusherInfoDelegate::onPushStoped:

◆ stopRecording

- (void) stopRecording

Stoplocal media recording.

Note
If the recording task has not been stopped through this interface before the streaming is ended, the recording task will be automatically stopped after the streaming is ended.

◆ stopScreenShare

- (int) stopScreenShare

stop screen share

Returns
  • YES: success
  • NO: failure

◆ switchCamera

- (int) switchCamera

Switch between the front and rear cameras.

Returns
0:success != 0:failure

◆ unloadAudioEffectWithSoundId:

- (int) unloadAudioEffectWithSoundId: (NSInteger) soundId

Delete preloaded audio effect files.

Parameters
soundIdThe ID assigned by the user to the audio effect file
Returns
  • 0:success
  • !=0:failure
Note
The audio effect soundId should be the same as the ID passed in when preloading preloadAudioEffectWithSoundId:filePath:

◆ unregisterVideoSampleObserver

- (void) unregisterVideoSampleObserver

◆ updateLocalView:

- (void) updateLocalView: (UIView *) view

Update local camera preview.

Parameters
viewcamera preview view
Note
If you need to update the rendering View (for example, you just started rendering on the A view and need to update it to render on the B view), you can call this interface.
Note: This API is currently only supported in livePushMode = AlivcLivePushInteractiveMode mode. This API is temporarily not supported in AlivcLivePushBasicMode mode, and the call has no effect.

The documentation for this class was generated from the following file: