Node Publisher Api
Node Publisher Api
NodePublisher is used for RTMP live streaming, supports H.264 + AAC / SPEEX
encoding, 16: 9/4: 3/1: 1 picture, built-in GPU accelerated beauty filter.
Table of Contents
==================
## Attributes
### setOutputUrl ()
Set video output address, support RTMP / RTMPT / HTTP format, FLV package
### setPageUrl ()
Set pageUrl address under RTMP protocol.
### setSwfUrl ()
Set swfUrl address under RTMP protocol set
### setConnArgs ()
Set the parameters attached to the connect command issued under the RTMP protocol
set. RTMPDUMP style
> Append arbitrary AMF data to the Connect message. The type must be B for Boolean,
N for number, S for string, O for object, or Z for null. For Booleans the data must
be either 0 or 1 for FALSE or TRUE, respectively. Likewise for Objects the data
must be 0 or 1 to end or begin an object, respectively. Data items in subobjects
may be named, by prefixing the type with 'N' and specifying the name before the
value, eg NB: myFlag: 1. This option may be used multiple times to construct
arbitrary AMF sequences. Eg
** S: info O: 1 NS: uid: 10012 NB: vip: 1 NN: num: 209.12 O: 0 **
### setFlashEnable ()
Set whether the flash is always on
### setVideoParam (int preset, int fps, int bitrate, int profile, boolean
frontMirror)
Set video encoding parameters
-Parameter 1: [Video resolution preset] (VIDEO_PPRESET)
-Parameter 2: Video frame rate
-Parameter 3: Video bit rate
-Parameter 4: Video encoding specifications
-NodePublisher.VIDEO_PROFILE_BASELINE
-NodePublisher.VIDEO_PROFILE_MAIN
-NodePublisher.VIDEO_PROFILE_HIGH
-Parameter 5: Whether the video output screen is mirrored
### setBeautyLevel (int beautyLevel)
Set beauty level, 0-5, 0 off, 1-5 levels
## Method
### switchCamera ()
Switch front and rear cameras
### startPreview ()
Camera starts preview
### stopPreview ()
Camera stops preview
### start ()
Start streaming
### stop ()
Stop streaming
### release ()
Release the underlying resources
## Event callback
### 2000
Publishing video
### 2001
Video posted successfully
### 2002
Video publishing failed
### 2004
Video release ended
### 2005
During the video release, the network is abnormal and the release is interrupted
### 2100
Network congestion, release freeze
### 2101
Network recovery, smooth release
## VIDEO_PPRESET
```
public static final int VIDEO_PPRESET_16X9_270 = 0;
public static final int VIDEO_PPRESET_16X9_360 = 1;
public static final int VIDEO_PPRESET_16X9_480 = 2;
public static final int VIDEO_PPRESET_16X9_540 = 3;
public static final int VIDEO_PPRESET_16X9_720 = 4;