Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(shared): 补全 LivePlayer 微信端缺失属性 #7258

Merged
merged 2 commits into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/shared/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
19 changes: 17 additions & 2 deletions packages/taro-components/types/LivePlayer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -87,12 +92,22 @@ interface LivePlayerProps extends StandardProps {
/** 网络状态通知,detail = {info}
* @supported weapp
*/
onNetstatus?: CommonEventFunction<LivePlayerProps.onNetStatusEventDetail>
onNetStatus?: CommonEventFunction<LivePlayerProps.onNetStatusEventDetail>

/** 播放音量大小通知,detail = {}
* @supported weapp
*/
onAudioVolumenotify?: CommonEventFunction<{}>
onAudioVolumeNotify?: CommonEventFunction<{}>

/** 播放器进入小窗
* @supported weapp
*/
onEnterPictureInPicture?: CommonEventFunction

/** 播放器退出小窗
* @supported weapp
*/
onLeavePictureInPicture?: CommonEventFunction
}

declare namespace LivePlayerProps {
Expand Down