![]() |
AlivcLivePusher v7.1.0
Aliyun Live Pusher API Reference Manual for iOS Platforms
|
#include "AlivcLivePusher.h"
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. | |
+ ("Use AlivcLiveBase->getSDKVersion instead.") __deprecated_msg |
Query the version number of the SDK.
- (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.
waterMarkDirPath:The | sequence path of the animated sticker. |
The | position x of the display screen.(0~1.0f) |
The | position y of the display screen.(0~1.0f) |
The | width of the display screen |
The | height of the display screen |
- (int) addExternalAudioStream: | (AliLiveExternalAudioStreamConfig *_Nonnull) | config |
add external audio stream
config | external audio stream configuration |
- (int) addMixAudio: | (int) | channels | |
format: | (int) | format | |
audioSample: | (int) | audioSample |
Add audio stream mixing settings.
channels | The number of sound channels |
format | The format of the audio AlivcLivePushAudioFormat |
audioSample | The audio sample rate |
- (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.
format | The format of the raw video data |
width | The width of the video |
height | The height of the video |
rotation | The angle of the video |
displayX | The coordinate value along the x-axis to place the video in the upper-left corner. |
displayY | The coordinate value along the y-axis to place the video in the upper-left corner. |
displayW | The display width of the video |
displayH | The display height of the video |
adjustHeight | The adaptive height of the video |
- (int) addWatermarkWithPath: | (NSString *) | path | |
watermarkCoordX: | (CGFloat) | coordX | |
watermarkCoordY: | (CGFloat) | coordY | |
watermarkWidth: | (CGFloat) | width |
Add watermarks.
You can add up to three watermarks
path | The path of the watermark |
coordX | The coordinate of the watermark along the x-axis relative to the vertex in the upper-left corner |
coordY | The coordinate of the watermark along the y-axis relative to the vertex in the upper-left corner |
width | The relative width of the watermark. (The watermark is proportionally scaled based on the actual width of the watermark image.) (0,1] |
- (void) changeMixVideoPosition: | (int) | handler | |
displayX: | (float) | displayX | |
displayY: | (float) | displayY | |
displayW: | (float) | displayW | |
displayH: | (float) | displayH |
Modify the position of the mixed video stream.
handler | The ID of the mixed video stream. You can obtain the ID from the addMixVideo request |
displayX | The coordinate value along the x-axis to place the video in the upper-left corner. |
displayY | The coordinate value along the y-axis to place the video in the upper-left corner. |
displayW | The display width of the video |
displayHThe | display height of the video |
- (void) destory |
Destroys the live pusher engine.
- (int) enableAudioFrameObserver: | (bool) | enable | |
audioSource: | (AliLiveAudioSource) | audioSource | |
config: | (AliLiveAudioFrameObserverConfig *_Nullable) | config |
- (int) enableAudioVolumeIndication: | (int) | interval | |
smooth: | (int) | smooth | |
reportVad: | (int) | reportVad |
- (int) enableLocalCamera: | (BOOL) | enabled |
Disable or enable local video capture.
enabled |
|
- (int) enableSEIVideoStream: | (bool) | enable |
- (int) enableSpeakerphone: | (BOOL) | enable |
Set the headset or speaker as the audio output device.
enable | YES: (Default) Speaker; NO:Headset |
- (int) focusCameraAtAdjustedPoint: | (CGPoint) | point | |
autoFocus: | (bool) | autoFocus |
Configure focus.
point | The 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 |
autoFocus | Whether to enable autofocus |
- (int) getAudioEffectPlayoutVolumeWithSoundId: | (NSInteger) | soundId |
Get the local playback volume of audio effects.
soundId | The ID assigned by the user to the audio effect file |
playAudioEffectWithSoundId:filePath:config:
- (int) getAudioEffectPublishVolumeWithSoundId: | (NSInteger) | soundId |
Get the audio effect push mixing volume.
soundId | The ID assigned by the user to the audio effect file |
playAudioEffectWithSoundId:filePath:config:
- (int) getBGMCurrentPosition |
Get the music file playback progress, in milliseconds.
- (int) getBGMDuration |
Get the duration of the music file, in milliseconds.
- (AlivcLiveVideoCodecManufacturer) getCurrentEncoderManufacturer: | (BOOL) | isCameraStreem |
- (float) getCurrentExposure |
Query the current exposure level.
- (float) getCurrentZoom |
Query the current zoom value.
- (AlivcLivePushStatsInfo *) getLivePushStatusInfo |
Query the statistics on live pusher.
AlivcLivePushStatsInfo
- (AlivcLivePushStatus) getLiveStatus |
Query the live push status.
- (float) getMaxZoom |
Query the maximum zoom value that is supported.
- (NSString *) getParameter: | (NSString *) | param |
- (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.
+ (void) hideDebugView |
Hide the debugging window.
- (instancetype) initWithConfig: | (AlivcLivePushConfig *) | config |
Create a live pusher engine.
config | Configure live pusher AlivcLivePushConfig |
AlivcLivePusher::destroy
- (bool) inputMixAudioData: | (int) | handler | |
data: | (long) | dataptr | |
size: | (int) | size | |
pts: | (long) | pts |
Import audio stream mixing data.
handler | The ID of the mixed audio stream. You can obtain the ID from the addMixAudio request |
dataptr | The address of the data buffer |
size | The size of the audio data |
pts | The presentation timestamp. Unit: microsecond |
- (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.
handler | The ID of the mixed video stream. You can obtain the ID from the addMixVideo request |
dataptr | The address of the data buffer |
width | The width of the video |
height | The height of the video |
stride | stride |
size | The space occupied by each row of pixels in memory when the video is stored |
pts | The presentation timestamp. Unit: microsecond |
rotationThe | angle of the video |
- (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: | (BOOL) | mute |
Specify whether to disable video capture from the camera.
(This method is not supported in basic mode.)
mute | YES No video data is sent from the camera.;NO Video data is sent 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: | (NSInteger) | soundId |
Pause specified audio effect files.
soundId | The ID assigned by the user to the audio effect file |
- (int) pauseBGM |
Pause the playback of background music.
- (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.
soundId | The 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 |
filePath | File path, supports local files and network URLs |
config | Audio effect playback configuration, see AliLiveAudioEffectConfig for details |
- (int) preloadAudioEffectWithSoundId: | (NSInteger) | soundId | |
filePath: | (NSString *_Nonnull) | filePath |
Preload audio effect files.
soundId | The ID assigned by the user to the audio effect file |
filePath | audio effect file path, supports local files and network URLs |
- (int) pushExternalAudioStream: | (int) | streamId | |
rawData: | (AlivcLivePusherAudioDataSample *_Nonnull) | audioFrame |
Input external audio stream data.
streamId | external audio stream ID(addExternalAudioStream return) |
audioFrame | audio data |
- (int) pushExternalVideoFrame: | (AlivcLiveVideoDataSample *_Nonnull) | frame | |
sourceType: | (AliLiveVideoSource) | type |
input video raw data
frame | video raw data,see AlivcLiveVideoDataSample |
type | stream type,see AliLiveVideoSource
|
- (int) reconnectPushAsync |
Reconnect.
(This is an asynchronous method.)
- (int) reconnectPushAsync: | (NSString *) | pushURL |
Reconnect the push URL.
(This is an asynchronous method.)
- (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
pushURL | push URL |
- (void) registerVideoSampleObserver |
- (void) removeDynamicWaterMark: | (int) | vid |
Remove an animated sticker.
vid:The | animated sticker id,addDynamicWaterMarkImageDataWithPath return |
- (int) removeExternalAudioStream: | (int) | streamId |
Remove external audio stream.
streamId | external audio stream ID |
- (void) removeMixAudio: | (int) | handler |
Delete audio stream mixing settings.
handler | The ID of the mixed audio stream. You can obtain the ID from the addMixAudio request |
- (void) removeMixVideo: | (int) | handler |
Delete video stream mixing settings.
handler | The ID of the mixed video stream. You can obtain the ID from the addMixVideo request. |
- (int) restartPush |
Restart stream push.
(This is a synchronous method.)
- (int) restartPushAsync |
Restart stream push.
(This is an asynchronous method.)
- (int) resume |
Resume stream push from the camera.
(This is a synchronous method.)
- (int) resumeAllAudioEffects |
Resume all audio effect files.
- (int) resumeAsync |
Resume stream push.
(This is an asynchronous method.)
- (int) resumeAudioEffectWithSoundId: | (NSInteger) | soundId |
Resume specified audio effect files.
soundId | The ID assigned by the user to the audio effect file |
- (int) resumeBGM |
Resume the playback of background music.
- (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
sampleBuffer | audio sample buffer |
sampleBufferType | audio sample buffer type |
- (int) sendDataChannelMessage: | (NSString *) | message |
- (int) sendMessage: | (NSString *) | msg | |
repeatCount: | (int) | count | |
delayTime: | (int) | time | |
KeyFrameOnly: | (bool) | isKeyFrame |
Set a custom SEI message.
msg | The message |
count | The number of repetitions |
time | The latency. Unit: millisecond |
isKeyFrame | Whether 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 |
- (int) sendMessage: | (NSString *) | msg | |
repeatCount: | (int) | count | |
delayTime: | (int) | time | |
KeyFrameOnly: | (bool) | isKeyFrame | |
payloadType: | (int) | payloadType |
Set a custom SEI message.
msg | The message |
count | The number of repetitions |
time | The latency. Unit: millisecond |
isKeyFrame | Whether 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 |
payloadType | payloadType 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. |
- (void) sendPCMData: | (char *) | data | |
size: | (int) | size | |
sampleRate: | (int) | sampleRate | |
channel: | (int) | channel | |
pts: | (uint64_t) | pts |
Send custom audio data.
data | The audio data |
size | The data size |
sampleRate | The sample rate |
channel | The number of sound channels |
pts | The presentation timestamp. Unit: microsecond |
- (void) sendVideoData: | (char *) | data | |
width: | (int) | width | |
height: | (int) | height | |
size: | (int) | size | |
pts: | (uint64_t) | pts | |
rotation: | (int) | rotation |
Send custom video data.
data | The video data |
width | The width of the video |
height | The height of the video |
size | The data size |
pts | The presentation timestamp. Unit: microsecond |
rotation | The rotation degree |
- (void) sendVideoSampleBuffer: | (CMSampleBufferRef) | sampleBuffer |
Send custom video SampleBuffer.
sampleBuffer | video sample buffer |
- (int) setAllAudioEffectsPlayoutVolume: | (NSInteger) | volume |
Set the local playback volume of all audio effects.
volume | Audio effect local playback volume, range: [0, 100], default value: 50 |
- (int) setAllAudioEffectsPublishVolume: | (NSInteger) | volume |
Set the mixing volume of all audio effects push streaming.
volume | Push mix volume, range is: [0, 100], default value: 50 |
- (int) setAudioDenoise: | (bool) | isOpen |
Specify whether to enable noise reduction.
isOpen | Whether to enable noise reduction. true:Enabled false:Disabled default:true |
- (int) setAudioEffectBeautifyMode: | (AliLiveAudioEffectBeautifyMode) | mode |
Set the sound mode.
mode | see AliLiveAudioEffectBeautifyMode |
- (int) setAudioEffectEqualizationParam: | (AliLiveAudioEffectEqualizationBandFrequency) | bandIndex | |
gain: | (float) | gain |
- (int) setAudioEffectPitchValue: | (double) | value |
Set audio pitch parameters.
value | audio 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 |
- (int) setAudioEffectPlayoutVolumeWithSoundId: | (NSInteger) | soundId | |
volume: | (NSInteger) | volume |
Set the local playback volume of audio effects.
soundId | The ID assigned by the user to the audio effect file |
volume | playback mix volume, range is: [0, 100], default value: 50 |
playAudioEffectWithSoundId:filePath:config:
- (int) setAudioEffectPublishVolumeWithSoundId: | (NSInteger) | soundId | |
volume: | (NSInteger) | volume |
Set audio effect push mixing volume.
soundId | The ID assigned by the user to the audio effect file |
volume | Push mix volume, range is: [0, 100], default value: 50 |
playAudioEffectWithSoundId:filePath:config:
- (int) setAudioEffectReverbMode: | (AlivcLivePushAudioEffectReverbMode) | mode |
Set the reverberation mode.
mode | Reference AlivcLivePushAudioEffectReverbMode Values that specify the reverberation effects. |
- (int) setAudioEffectReverbParamType: | (AliLiveAudioEffectReverbParamType) | type | |
value: | (float) | value |
Set the reverb audio effect type.
type | see AliLiveAudioEffectReverbParamType |
value |
- (int) setAudioEffectVoiceChangeMode: | (AlivcLivePushAudioEffectVoiceChangeMode) | mode |
Set the voice change mode.
mode | Reference AlivcLivePushAudioEffectVoiceChangerMode Values that specify the voice change effects. |
- (int) setAudioProfile: | (AlivcLiveAudioProfile) | audio_profile |
set audio profile
audio_profile | Audio capture/encoding mode parameters, see for details AlivcLiveAudioProfile |
- (void) setAudioSampleDelegate: | (id< AlivcLivePusherAudioSampleDelegate >) | delegate |
Set the callback for raw audio data.
delegate | AlivcLivePusherAudioSampleDelegate |
- (int) setAutoFocus: | (bool) | autoFocus |
Specify whether to enable autofocus.
autoFocus | true:autofocus false:Manual focus |
- (void) setBGMDelegate: | (id< AlivcLivePusherBGMDelegate >) | delegate |
Set the callback for background music.
delegate | AlivcLivePusherBGMDelegate |
- (int) setBGMEarsBack: | (bool) | isOpen |
Specify whether to enable in-ear monitoring for background music.
isOpen | Whether to enable in-ear monitoring. true:Enabled false:Disabled |
- (int) setBGMLoop: | (bool) | isLoop |
Specify whether to enable loop playback of background music.
isLoop | Whether to loop. true:Loop false:No loop |
- (int) setBGMVolume: | (int) | volume |
Set the volume of music in mixed audio.
volume | The music volume.:[0 ~ 100] default:50 |
- (BOOL) setCameraAutoFocusFaceModeEnabled: | (BOOL) | enable |
Set camera face focus.
enable | YES: open; NO:close |
- (int) setCaptureVolume: | (int) | volume |
Set the volume of vocal in mixed audio.
volume | The vocal volume.:[0 ~ 100] default:50 |
- (int) setChannelProfile: | (AlivcLiveChannelProfile) | profile |
- (void) setCustomDetectorDelegate: | (id< AlivcLivePusherCustomDetectorDelegate >) | delegate |
Set a custom facial recognition callback.
delegate | AlivcLivePusherCustomDetectorDelegate |
- (void) setCustomFilterDelegate: | (id< AlivcLivePusherCustomFilterDelegate >) | delegate |
Set a custom filter callback.
delegate | AlivcLivePusherCustomFilterDelegate |
- (int) setCustomVideoResolution: | (CGSize) | videoSize |
- (void) setErrorDelegate: | (id< AlivcLivePusherErrorDelegate >) | delegate |
Set the callback for live pusher engine errors.
delegate | AlivcLivePusherErrorDelegate |
- (int) setExposure: | (float) | exposure |
Specify the exposure level.
exposure | The exposure level |
- (int) setExternalAudioSource: | (BOOL) | enable | |
withSampleRate: | (NSUInteger) | sampleRate | |
channelsPerFrame: | (NSUInteger) | channelsPerFrame |
Set whether to enable external audio input source.
enable | YES: Enable; NO: Disable |
sampleRate | samplerate 16k, 48k... |
channelsPerFrame | Channels: 1: mono; 2:stereo |
- (int) setExternalAudioStream: | (int) | streamId | |
playoutVolume: | (int) | playoutVolume |
Set external audio stream playback volume.
streamId | external audio stream ID |
playoutVolume | Playback volume, value range [0, 100] |
- (int) setExternalAudioStream: | (int) | streamId | |
publishVolume: | (int) | publishVolume |
Set external audio streaming volume.
streamId | external audio stream ID |
publishVolume | Push volume, value range [0, 100] |
- (int) setExternalVideoSource: | (BOOL) | enable | |
sourceType: | (AliLiveVideoSource) | type | |
renderMode: | (AliLiveRenderMode) | renderMode |
Enable external video input source.
enable |
|
type | stream type,see AliLiveVideoSource
|
renderMode | render 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
|
- (int) setFlash: | (bool) | flash |
Specify whether to turn on the flash.
flash | true:Turn on the flash. false:Turn off the flash |
- (void) setInfoDelegate: | (id< AlivcLivePusherInfoDelegate >) | delegate |
Set the callback for live pusher engine status.
delegate | AlivcLivePusherInfoDelegate |
- (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
config | Refer to the description about AlivcLiveTranscodingConfig in the AlivcLiveDef.h file If you pass nil to the parameter, mixed-stream transcoding is disabled |
- (int) setLogLevel: | ("Use AlivcLiveBase->setLogLevel instead.") | __deprecated_msg |
Set the log level.
level | Log default:AlivcLivePushLogLevelError |
- (int) setLogPath: | (NSString *) | logPath | |
maxPartFileSizeInKB: | ("Use AlivcLiveBase->setLogPath:maxPartFileSizeInKB instead.") | __deprecated_msg |
Set the log path.
logPath | Log path |
maxPartFileSizeInKB | The maximum size of each part. The total volume of logs is five times the maximum part size. |
- (int) setMinVideoBitrate: | (int) | minBitrate |
Specify the minimum bitrate.
minBitrate | The minimum bitrate. [100 5000](Kbps) |
- (int) setMixedWithMic: | (BOOL) | mixed |
Set whether to mix audio collected with the microphone.
mixed | YES:mix;NO:Completely replace the microphone to collect data |
- (void) setMixVideoMirror: | (int) | handler | |
isMirror: | (BOOL) | isMirror |
Modify the mirroring settings for the mixed video stream.
handler | The ID of the mixed video stream. You can obtain the ID from the addMixVideo request. |
isMirror | Whether to enable mirroring |
- (void) setMute: | (bool) | mute |
Mute the audio stream.
mute | true:mute false:Normal |
AlivcLivePusher::stopAudioCapture
- (void) setMute: | (BOOL) | mute | |
mode: | (AliLiveMuteLocalAudioMode) | mode |
Mute the audio stream.
mute | true:mute false:Normal |
mode | mute mode. There are three types of mute modes. For details, see AliLiveMuteLocalAudioMode |
AlivcLivePusher::stopAudioCapture
- (void) setNetworkDelegate: | (id< AlivcLivePusherNetworkDelegate >) | delegate |
Set the callback for the network status of live pusher engine.
delegate | AlivcLivePusherNetworkDelegate |
- (int) setParameter: | (NSString *_Nonnull) | param |
Set custom parameters.
param | Custom parameters |
- (void) setpreviewDisplayMode: | (AlivcPusherPreviewDisplayMode) | displayMode |
Specify the preview mode.
displayMode | The preview mode |
- (void) setPreviewMirror: | (bool) | mirror |
Specify whether to enable the mirroring mode for preview.
mirror | true:Enable the mirroring mode for preview. false:Disable the mirroring mode for preview. |
- (void) setPushMirror: | (bool) | mirror |
Specify whether to enable the mirroring mode for live pusher.
mirror | true:Enable the mirroring mode for stream push. false:Disable the mirroring mode for stream push |
- (int) setQualityMode: | (AlivcLivePushQualityMode) | qualityMode |
Specify the quality mode.
qualityMode | If 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. |
- (void) setResolution: | (AlivcLivePushResolution) | resolution |
Specify the resolution, which takes effect only in preview mode.
resolution | The resolution of the ingested stream |
- (void) setSnapshotDelegate: | (id< AlivcLivePusherSnapshotDelegate >) | delegate |
Set the callback for snapshot capture.
delegate | AlivcLivePusherSnapshotDelegate |
- (int) setTargetVideoBitrate: | (int) | targetBitrate |
Specify the target bitrate.
targetBitrate | The target bitrate [100 5000](Kbps) |
- (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
config | Predefined encoding properties, see AliLiveVideoEncoderConfiguration |
- (int) setVideoMirrorMode: | (AliLiveVideoPipelineMirrorMode) | mirrorMode |
Set up preview and pushing mirror.
mirrorMode | mirror mode |
- (void) setWatermark: | (nullable UIImage *) | image | |
rect: | (CGRect) | rect |
- (void) setWatermarkVisible: | (bool) | visable |
Specify whether to show or hide watermarks.
visable | true:Show watermarks.,false:Hide watermarks. |
- (int) setZoom: | (float) | zoom |
Configure zoom.
zoom | The zoom value.[0:MaxZoom] |
+ (void) showDebugView |
Show the debugging window.
- (void) snapshot: | (int) | count | |
interval: | (int) | interval |
Configure snapshot settings.
count | The number of snapshots |
interval | The interval between snapshots |
- (void) startAudioCapture: | (BOOL) | keepAlive |
Start microphone capture.
keepAlive | YES: The microphone device remains on after stopping push ;NO: The microphone device is turned off after stopping push |
AlivcLivePusher::stopAudioCapture
AlivcLivePusher::setMute:
- (void) startAudioPlayer |
Enable audio playback.
- (int) startBGMWithMusicPathAsync: | (NSString *) | path |
Play background music.
path | The path of the background music |
- (int) startBGMWithMusicPathAsync: | (NSString *) | path | |
config: | (AlivcLiveBGMConfig *_Nonnull) | config |
Play background music.
path | The path of the background music |
config | The config of the background music |
- (int) startIntelligentDenoise |
Enable intelligent noise reduction.
- (int) startLastmileDetect: | (AliLiveNetworkQualityProbeConfig *_Nonnull) | config |
Start network quality detection.
config | Network detection configuration,AliLiveNetworkQualityProbeConfig |
Network quality detection needs to be called before startPush. As a result of the detection, startLastmileDetect cannot be called after startPush
AlivcLivePusherNetworkDelegate::onLastmileDetectResultWithQuality:networkQuality:
AlivcLivePusherNetworkDelegate::onLastmileDetectResultWithBandWidth:code:result:
- (int) startLocalDualAudioStream |
Enable the second audio stream push.
- (int) startPreview: | (UIView *) | previewView |
Start preview.
(This is a synchronous method.)
previewView | view |
AlivcLivePusherInfoDelegate::onPreviewStarted:
AlivcLivePusherInfoDelegate::onFirstFramePreviewed:
AlivcLivePusher::updateLocalView:
AlivcLivePushConfig::previewDisplayMode
or AlivcLivePusher::setpreviewDisplayMode:
- (int) startPreviewAsync: | (UIView *) | preview |
Start preview.
(This is an asynchronous method.)
preview | view |
AlivcLivePusherInfoDelegate::onPreviewStarted:
AlivcLivePusherInfoDelegate::onFirstFramePreviewed:
AlivcLivePusher::updateLocalView:
AlivcLivePushConfig::previewDisplayMode
or AlivcLivePusher::setpreviewDisplayMode:
- (int) startPushWithURL: | (NSString *) | pushURL |
Start stream push.
(This is a synchronous method.)
pushURL | push URL |
AlivcLivePusherInfoDelegate::onPushStarted:
AlivcLivePusherInfoDelegate::onFirstFramePushed:
- (int) startPushWithURLAsync: | (NSString *) | pushURL |
Start stream push.
(This is an asynchronous method.)
pushURL | push URL |
AlivcLivePusherInfoDelegate::onPushStarted:
AlivcLivePusherInfoDelegate::onFirstFramePushed:
- (BOOL) startRecording: | (AlivcLiveLocalRecoderConfig *_Nullable) | config |
Enable local media recording.
config | Local recording parameters, see AlivcLiveLocalRecoderConfig |
- (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.
appGroup | App 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. |
- (int) startScreenShare |
Start screen share.
- (int) stopAllAudioEffects |
Stop playing all audio effect.
- (void) stopAudioCapture |
Stop microphone capture.
AlivcLivePusher::startAudioCapture:
AlivcLivePusher::setMute:
- (int) stopAudioEffectWithSoundId: | (NSInteger) | soundId |
Stop playing audio effects.
soundId | The 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 |
- (void) stopAudioPlayer |
Turn off audio playback.
startAudioPlayer
- (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.
AlivcLivePusherInfoDelegate::onPreviewStoped:
- (int) stopPush |
Stop stream push.
AlivcLivePusherInfoDelegate::onPushStoped:
- (void) stopRecording |
Stoplocal media recording.
- (int) stopScreenShare |
stop screen share
- (int) switchCamera |
Switch between the front and rear cameras.
- (int) unloadAudioEffectWithSoundId: | (NSInteger) | soundId |
Delete preloaded audio effect files.
soundId | The ID assigned by the user to the audio effect file |
preloadAudioEffectWithSoundId:filePath:
- (void) unregisterVideoSampleObserver |
- (void) updateLocalView: | (UIView *) | view |
Update local camera preview.
view | camera preview view |