ref |>修复缺陷 20481- 进入拉流直播-whh6666直播间-点击全屏按钮,进入全屏,播放控件和标题未实现3s自动隐藏
Showing
2 changed files
with
20 additions
and
3 deletions
| @@ -13,9 +13,26 @@ import { DisplayDirection } from 'wdConstant'; | @@ -13,9 +13,26 @@ import { DisplayDirection } from 'wdConstant'; | ||
| 13 | export struct PlayerUIComponent { | 13 | export struct PlayerUIComponent { |
| 14 | private playerController?: WDAliPlayerController | 14 | private playerController?: WDAliPlayerController |
| 15 | @Provide isSmall:boolean = false | 15 | @Provide isSmall:boolean = false |
| 16 | - @Consume isShowControl: boolean | 16 | + @Consume @Watch('onChangeMenuVisible') isShowControl: boolean |
| 17 | @Consume isFullScreen: boolean | 17 | @Consume isFullScreen: boolean |
| 18 | @Consume displayDirection: DisplayDirection | 18 | @Consume displayDirection: DisplayDirection |
| 19 | + @State isPlayStatus: boolean = true; | ||
| 20 | + onChangeMenuVisible() { | ||
| 21 | + if (this.displayDirection == DisplayDirection.VERTICAL | ||
| 22 | + || !this.isShowControl | ||
| 23 | + || !this.isPlayStatus) { | ||
| 24 | + return | ||
| 25 | + } | ||
| 26 | + let time: number = 0 | ||
| 27 | + if (this.isShowControl) { | ||
| 28 | + setTimeout(() => { | ||
| 29 | + this.isShowControl = false | ||
| 30 | + }, 5 * 1000) | ||
| 31 | + } else { | ||
| 32 | + clearTimeout(time) | ||
| 33 | + } | ||
| 34 | + } | ||
| 35 | + | ||
| 19 | aboutToAppear() { | 36 | aboutToAppear() { |
| 20 | if (!this.playerController) { | 37 | if (!this.playerController) { |
| 21 | return | 38 | return |
| @@ -76,7 +93,7 @@ export struct PlayerUIComponent { | @@ -76,7 +93,7 @@ export struct PlayerUIComponent { | ||
| 76 | .position({ y: '100%' }) | 93 | .position({ y: '100%' }) |
| 77 | .markAnchor({ y: '100%' }) | 94 | .markAnchor({ y: '100%' }) |
| 78 | 95 | ||
| 79 | - PlayerVideoControlComponent({ playerController: this.playerController }) | 96 | + PlayerVideoControlComponent({ playerController: this.playerController,isPlayStatus: $isPlayStatus}) |
| 80 | .visibility(this.isShowControl ? Visibility.Visible : Visibility.Hidden) | 97 | .visibility(this.isShowControl ? Visibility.Visible : Visibility.Hidden) |
| 81 | .animation({ duration: 500 }) | 98 | .animation({ duration: 500 }) |
| 82 | .position({ y: '100%' }) | 99 | .position({ y: '100%' }) |
| @@ -13,7 +13,7 @@ export struct PlayerVideoControlComponent { | @@ -13,7 +13,7 @@ export struct PlayerVideoControlComponent { | ||
| 13 | @State totalTime: string = '' | 13 | @State totalTime: string = '' |
| 14 | @State progressVal: number = 0; | 14 | @State progressVal: number = 0; |
| 15 | //是否处于播放状态中 | 15 | //是否处于播放状态中 |
| 16 | - @State isPlayStatus: boolean = true | 16 | + @Link isPlayStatus?: boolean |
| 17 | @Consume displayDirection: DisplayDirection | 17 | @Consume displayDirection: DisplayDirection |
| 18 | @Consume contentDetailData: ContentDetailDTO | 18 | @Consume contentDetailData: ContentDetailDTO |
| 19 | @Consume isSmall:boolean | 19 | @Consume isSmall:boolean |
-
Please register or login to post a comment