Skip to main content
Version: Next

LivePusher

Real-time audio/video recording. User Authorization is required for scope.camera and scope.record.

Currently, it is open only to Mini Programs in the following categories owned by Chinese entities. The component needs to pass the category review, and then on the Mini Program Console, you can activate the permissions for this component by choosing Development > API Settings.

Reference

Type

ComponentType<LivePusherProps>

Examples

class App extends Components {
render () {
return (
<LivePusher url='url' mode='RTC' autopush />
)
}
}

LivePusherProps

PropertyTypeDefaultRequiredDescription
urlstringNoThe stream pushing address. Only `flv` and `rtmp` formats are supported.
mode"SD" | "HD" | "FHD" | "RTC""RTC"NoValues include SD (Standard definition), HD (High definition), FHD (Full high definition), and RTC (Real-time call).
autopushbooleanfalseNoAuto stream pushing.
mutedbooleanfalseNoSpecifies whether to mute the component.
Not recommend
enableCamerabooleantrueNoEnables the camera.
autoFocusbooleantrueNoAuto focusing.
orientation"vertical" | "horizontal""vertical"NoThe orientation of the image.
beautynumber0NoBeautifying. Values range from 0 to 9. 0 indicates disabled.
whitenessnumber0NoWhitening. Values range from 0 to 9. 0 indicates disabled.
aspect"9:16" | "3:4""9:16"NoThe aspect ratio. Available values include 3:4 and 9:16.
minBitratenumber200NoThe minimum bitrate.
maxBitratenumber1000NoThe maximum bitrate.
audioQualitystring"high"NoHigh quality (48KHz) or low quality (16KHz). Values include "high" and "low".
waitingImagestringNoThe waiting image for stream pushing when the component enters the background.
waitingImageHashstringNoThe MD5 value of resources on the waiting image.
zoombooleanfalseNoAdjusts the focal length.
devicePositionstring"front"NoFront or back. Values include front and back.
backgroundMutebooleanfalseNoSpecifies whether to mute the component after the component enters the background.
mirrorbooleanfalseNoSpecifies whether to mirror the stream pushing image. The effects are reflected in live-player.
Not recommended.
remoteMirrorbooleanfalseNoSpecifies whether to mirror the pushstream screen.
Note: Same as attribute mirror, Plan to dispose of mirror
localMirror"auto" | "enable" | "disable""auto"NoSpecifies whether to mirror the local preview image.
audioReverbType0 | 1 | 2 | 3 | 4 | 5 | 6 | 70NoAudio reverberation types.
enableMicbooleantrueNoTurning the microphone on or off
enableAgcbooleanfalseNoSpecifies whether to turn on audio auto gain.
enableAnsbooleanfalseNoSpecifies whether to turn on audio noise suppression
audioVolumeType"media" | "voicecall""voicecall"NoVolume type
videoWidthnumber360NoThe resolution width of the video stream pushed up
videoHeightnumber640NoThe resolution height of the video stream pushed up
onStateChangeBaseEventOrigFunction<onStateChangeEventDetail>NoThe status change event. detail = {code}
onNetstatusBaseEventOrigFunction<onNetstatusEventDetail>NoThe notification of the network status. detail = {info}
onErrorBaseEventOrigFunction<onErrorEventDetail>NoThe rendering error event. detail = {errMsg, errCode}
onBgmStartBaseEventOrigFunction<any>NoTriggered when the background music starts playing.
onBgmProgressBaseEventOrigFunction<onBgmProgressEventDetail>NoTriggered when the progress of the background music changes. detail = {progress, duration}
onBgmCompleteBaseEventOrigFunction<any>NoTriggered when the background music stops playing.

Property Support

APIWeChat Mini-ProgramH5React Native
LivePusherProps.url✔️
LivePusherProps.mode✔️
LivePusherProps.autopush✔️
LivePusherProps.muted✔️
LivePusherProps.enableCamera✔️
LivePusherProps.autoFocus✔️
LivePusherProps.orientation✔️
LivePusherProps.beauty✔️
LivePusherProps.whiteness✔️
LivePusherProps.aspect✔️
LivePusherProps.minBitrate✔️
LivePusherProps.maxBitrate✔️
LivePusherProps.audioQuality✔️
LivePusherProps.waitingImage✔️
LivePusherProps.waitingImageHash✔️
LivePusherProps.zoom✔️
LivePusherProps.devicePosition✔️
LivePusherProps.backgroundMute✔️
LivePusherProps.mirror✔️
LivePusherProps.remoteMirror✔️
LivePusherProps.localMirror✔️
LivePusherProps.audioReverbType✔️
LivePusherProps.enableMic✔️
LivePusherProps.enableAgc✔️
LivePusherProps.enableAns✔️
LivePusherProps.audioVolumeType✔️
LivePusherProps.videoWidth✔️
LivePusherProps.videoHeight✔️
LivePusherProps.onStateChange✔️
LivePusherProps.onNetstatus✔️
LivePusherProps.onError✔️
LivePusherProps.onBgmStart✔️
LivePusherProps.onBgmProgress✔️
LivePusherProps.onBgmComplete✔️

orientation

Valid values of orientation

ValueDescription
verticalVertical
horizontalHorizontal

localMirror

Valid values of localMirror

ValueDescription
autoFront camera mirroring, rear camera not mirroring
enableBoth front and rear cameras mirrored
disableNeither the front nor the rear camera is mirrored

audioReverbType

Valid values of audioReverbType

ValueDescription
0Off
1KTV
2Small room
3Assembly Hall
4The muffled
5Loud and clear
6Metallic sound
7Magnetic

audioVolumeType

Valid values of audioVolumeType

ValueDescription
mediaMedia volume
voicecallCall volume

onStateChangeEventDetail

ParamTypeDescription
codenumberStatus Code

onNetstatusEventDetail

ParamTypeDescription
infonetStatusNetwork Status

onErrorEventDetail

ParamTypeDescription
errMsgstringError message
errCodestring | numberError code

onBgmProgressEventDetail

ParamTypeDescription
progressanyProgress
durationnumberDuration

API Support

APIWeChat Mini-ProgramH5React Native
LivePusher✔️