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.
Type
ComponentType<LivePusherProps>
Examples
- React
- Vue
class App extends Components {
render () {
return (
<LivePusher url='url' mode='RTC' autopush />
)
}
}
<template>
<live-pusher url="url" mode="RTC" :autopush="true" />
</template>
LivePusherProps
Property | Type | Default | Required | Description |
---|---|---|---|---|
url | string | No | The stream pushing address. Only `flv` and `rtmp` formats are supported. | |
mode | "SD" | "HD" | "FHD" | "RTC" | "RTC" | No | Values include SD (Standard definition), HD (High definition), FHD (Full high definition), and RTC (Real-time call). |
autopush | boolean | false | No | Auto stream pushing. |
muted | boolean | false | No | Specifies whether to mute the component. Not recommend |
enableCamera | boolean | true | No | Enables the camera. |
autoFocus | boolean | true | No | Auto focusing. |
orientation | "vertical" | "horizontal" | "vertical" | No | The orientation of the image. |
beauty | number | 0 | No | Beautifying. Values range from 0 to 9. 0 indicates disabled. |
whiteness | number | 0 | No | Whitening. Values range from 0 to 9. 0 indicates disabled. |
aspect | "9:16" | "3:4" | "9:16" | No | The aspect ratio. Available values include 3:4 and 9:16 . |
minBitrate | number | 200 | No | The minimum bitrate. |
maxBitrate | number | 1000 | No | The maximum bitrate. |
audioQuality | string | "high" | No | High quality (48KHz) or low quality (16KHz). Values include "high" and "low". |
waitingImage | string | No | The waiting image for stream pushing when the component enters the background. | |
waitingImageHash | string | No | The MD5 value of resources on the waiting image. | |
zoom | boolean | false | No | Adjusts the focal length. |
devicePosition | string | "front" | No | Front or back. Values include front and back . |
backgroundMute | boolean | false | No | Specifies whether to mute the component after the component enters the background. |
mirror | boolean | false | No | Specifies whether to mirror the stream pushing image. The effects are reflected in live-player. Not recommended. |
remoteMirror | boolean | false | No | Specifies whether to mirror the pushstream screen. Note: Same as attribute mirror, Plan to dispose of mirror |
localMirror | "auto" | "enable" | "disable" | "auto" | No | Specifies whether to mirror the local preview image. |
audioReverbType | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 0 | No | Audio reverberation types. |
enableMic | boolean | true | No | Turning the microphone on or off |
enableAgc | boolean | false | No | Specifies whether to turn on audio auto gain. |
enableAns | boolean | false | No | Specifies whether to turn on audio noise suppression |
audioVolumeType | "media" | "voicecall" | "voicecall" | No | Volume type |
videoWidth | number | 360 | No | The resolution width of the video stream pushed up |
videoHeight | number | 640 | No | The resolution height of the video stream pushed up |
onStateChange | BaseEventOrigFunction<onStateChangeEventDetail> | No | The status change event. detail = {code} | |
onNetstatus | BaseEventOrigFunction<onNetstatusEventDetail> | No | The notification of the network status. detail = {info} | |
onError | BaseEventOrigFunction<onErrorEventDetail> | No | The rendering error event. detail = {errMsg, errCode} | |
onBgmStart | BaseEventOrigFunction<any> | No | Triggered when the background music starts playing. | |
onBgmProgress | BaseEventOrigFunction<onBgmProgressEventDetail> | No | Triggered when the progress of the background music changes. detail = {progress, duration} | |
onBgmComplete | BaseEventOrigFunction<any> | No | Triggered when the background music stops playing. |
Property Support
API | WeChat Mini-Program | H5 | React 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
Value | Description |
---|---|
vertical | Vertical |
horizontal | Horizontal |
localMirror
Valid values of localMirror
Value | Description |
---|---|
auto | Front camera mirroring, rear camera not mirroring |
enable | Both front and rear cameras mirrored |
disable | Neither the front nor the rear camera is mirrored |
audioReverbType
Valid values of audioReverbType
Value | Description |
---|---|
0 | Off |
1 | KTV |
2 | Small room |
3 | Assembly Hall |
4 | The muffled |
5 | Loud and clear |
6 | Metallic sound |
7 | Magnetic |
audioVolumeType
Valid values of audioVolumeType
Value | Description |
---|---|
media | Media volume |
voicecall | Call volume |
onStateChangeEventDetail
Param | Type | Description |
---|---|---|
code | number | Status Code |
onNetstatusEventDetail
Param | Type | Description |
---|---|---|
info | netStatus | Network Status |
onErrorEventDetail
Param | Type | Description |
---|---|---|
errMsg | string | Error message |
errCode | string | number | Error code |
onBgmProgressEventDetail
Param | Type | Description |
---|---|---|
progress | any | Progress |
duration | number | Duration |
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
LivePusher | ✔️ |