Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix(wechat): 更新 LivePlayer、LivePusher 属性 (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicleo authored and yesmeck committed Apr 22, 2020
1 parent 6f5955e commit e5cd9da
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
10 changes: 9 additions & 1 deletion packages/remax-wechat/src/hostComponents/LivePlayer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,20 @@ export interface LivePlayerProps extends BaseProps {
autoPauseIfNavigate?: boolean;
/** (default: true) 当跳转到其它微信原生页面时,是否自动暂停本页面的实时音视频播放 2.5.0 */
autoPauseIfOpenNative?: boolean;
/** 设置小窗模式: push, pop,空字符串或通过数组形式设置多种模式(如: ["push", "pop"]) 2.10.3 */
pictureInPictureMode?: string | string[];
/** 播放状态变化事件,detail = {code} 1.7.0 */
onStateChange?: (event: any) => any;
/** 全屏变化事件,detail = {direction, fullScreen} 1.7.0 */
onFullScreenChange?: (event: any) => any;
onFullscreenChange?: (event: any) => any;
/** 网络状态通知,detail = {info} 1.9.0 */
onNetStatus?: (event: any) => any;
/** 播放音量大小通知,detail = {} 2.10.0 */
onAudioVolumeNotify?: (event: any) => any;
/** 播放器进入小窗 2.11.0 */
onEnterPictureInPicture?: (event: any) => any;
/** 播放器退出小窗 2.11.0 */
onLeavePictureInPicture?: (event: any) => any;
}

export default createHostComponent<LivePlayerProps>('live-player');
5 changes: 4 additions & 1 deletion packages/remax-wechat/src/hostComponents/LivePlayer/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ export const alias = {
soundMode: 'sound-mode',
autoPauseIfNavigate: 'auto-pause-if-navigate',
autoPauseIfOpenNative: 'auto-pause-if-open-native',
pictureInPictureMode: 'picture-in-picture-mode',
onStateChange: 'bindstatechange',
onFullscreenChange: 'bindfullscreenchange',
onFullScreenChange: 'bindfullscreenchange',
onNetStatus: 'bindnetstatus',
onAudioVolumeNotify: 'bindaudiovolumenotify',
onEnterPictureInPicture: 'bindenterpictureinpicture',
onLeavePictureInPicture: 'bindleavepictureinpicture',
animation: 'animation',
};

Expand Down
18 changes: 18 additions & 0 deletions packages/remax-wechat/src/hostComponents/LivePusher/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ export interface LivePusherProps extends BaseProps {
backgroundMute?: boolean;
/** (default: false) 设置推流画面是否镜像,产生的效果在 live-player 反应到 2.7.0 */
mirror?: boolean;
/** (default: false) 同 mirror 属性,后续 mirror 将废弃 2.10.0 */
remoteMirro?: boolean;
/** (default: auto) 控制本地预览画面是否镜像 2.10.0 */
localMirror?: 'auto' | 'enable' | 'disable';
/** (default: 0) 音频混响类型 2.10.0 */
audioReverbType?: number;
/** (default: true) 开启或关闭麦克风 2.10.0 */
enableMic?: boolean;
/** (default: false) 是否开启音频自动增益 2.10.0 */
enableAgc?: boolean;
/** (default: false) 是否开启音频噪声抑制 2.10.0 */
enableAns?: boolean;
/** (default: voicecall) 音量类型 2.10.0 */
audioVolumeType?: 'media' | 'voicecall';
/** (default: 360) 上推的视频流的分辨率宽度 2.10.0 */
videoWidth?: number;
/** (default: 640) 上推的视频流的分辨率高度 2.10.0 */
videoHeight?: number;
/** 状态变化事件,detail = {code} 1.7.0 */
onStateChange?: (event: any) => any;
/** 网络状态通知,detail = {info} 1.9.0 */
Expand Down
9 changes: 9 additions & 0 deletions packages/remax-wechat/src/hostComponents/LivePusher/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ export const alias = {
devicePosition: 'device-position',
backgroundMute: 'background-mute',
mirror: 'mirror',
remoteMirror: 'remote-mirror',
localMirror: 'local-mirror',
audioReverbType: 'audio-reverb-type',
enableMic: 'enable-mic',
enableAgc: 'enable-agc',
enableAns: 'enable-ans',
audioVolumeType: 'audio-volume-type',
videoWidth: 'video-width',
videoHeight: 'video-height',
onStateChange: 'bindstatechange',
onNetStatus: 'bindnetstatus',
onError: 'binderror',
Expand Down

0 comments on commit e5cd9da

Please sign in to comment.