From 5a27dd7e9a21f351278bc808ca1fdda8fe1564ee Mon Sep 17 00:00:00 2001 From: wuchangming Date: Tue, 4 Aug 2020 20:40:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(shared):=20=E8=A1=A5=E5=85=A8=20LivePlayer?= =?UTF-8?q?=20=E5=BE=AE=E4=BF=A1=E7=AB=AF=E7=BC=BA=E5=A4=B1=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/shared/src/components.ts | 6 +++++- .../taro-components/types/LivePlayer.d.ts | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/packages/shared/src/components.ts b/packages/shared/src/components.ts index db42c290c08b..160ba428fa04 100644 --- a/packages/shared/src/components.ts +++ b/packages/shared/src/components.ts @@ -492,9 +492,13 @@ const LivePlayer = { 'sound-mode': singleQuote('speaker'), 'auto-pause-if-navigate': 'true', 'auto-pause-if-open-native': 'true', + 'picture-in-picture-mode': '[]', bindStateChange: '', bindFullScreenChange: '', - bindNetStatus: '' + bindNetStatus: '', + bindAudioVolumeNotify: '', + bindEnterPictureInPicture: '', + bindLeavePictureInPicture: '' } const LivePusher = { diff --git a/packages/taro-components/types/LivePlayer.d.ts b/packages/taro-components/types/LivePlayer.d.ts index 31ebe040dcef..e9062b16a980 100644 --- a/packages/taro-components/types/LivePlayer.d.ts +++ b/packages/taro-components/types/LivePlayer.d.ts @@ -74,6 +74,11 @@ interface LivePlayerProps extends StandardProps { */ autoPauseIfOpenNavigate?: boolean + /** 设置小窗模式: push, pop,空字符串或通过数组形式设置多种模式(如: ["push", "pop"]) + * @supported weapp + */ + pictureInPictureMode?: ('push' | 'pop')[] | 'push' | 'pop' | '' + /** 播放状态变化事件,detail = {code} * @supported weapp */ @@ -87,12 +92,22 @@ interface LivePlayerProps extends StandardProps { /** 网络状态通知,detail = {info} * @supported weapp */ - onNetstatus?: CommonEventFunction + onNetStatus?: CommonEventFunction /** 播放音量大小通知,detail = {} * @supported weapp */ - onAudioVolumenotify?: CommonEventFunction<{}> + onAudioVolumeNotify?: CommonEventFunction<{}> + + /** 播放器进入小窗 + * @supported weapp + */ + onEnterPictureInPicture?: CommonEventFunction + + /** 播放器退出小窗 + * @supported weapp + */ + onLeavePictureInPicture?: CommonEventFunction } declare namespace LivePlayerProps {