wangliang_wd

feat:优化视频详情页,折叠屏展示问题

... ... @@ -466,7 +466,7 @@ export struct PlayUIComponent {
let timer = setTimeout(() => {
EmitterUtils.sendEvent(EmitterEventId.live_FULL_SCREEN, 0)
clearTimeout(timer)
}, 100)
}, 200)
let timer1 = setTimeout(() => {
EmitterUtils.sendEvent(EmitterEventId.live_half_SCREEN, 0)
... ...
... ... @@ -51,6 +51,7 @@ export struct DetailPlayShortVideoPage {
// @Consume windowHeight: number
@State windowHeight: number = WindowModel.shared.getWindowClass().getWindowProperties()?.windowRect.height
@Consume topSafeHeight: number
@Consume bottomSafeHeight: number
@Consume showComment: boolean // 是否显示底部评论,首页视频频道传false
@State imageVisible: boolean = true
@State ratio: number = 16 / 9
... ... @@ -316,8 +317,8 @@ export struct DetailPlayShortVideoPage {
this.playerHeight = px2vp(width / this.ratio)
} else {
// 否则高度撑满
this.playerHeight = px2vp(height)
this.playerWidth = px2vp(height * this.ratio)
this.playerHeight = px2vp(height - (this.isPad?(this.topSafeHeight + this.bottomSafeHeight):0))
this.playerWidth = px2vp((height - (this.isPad?(this.topSafeHeight + this.bottomSafeHeight):0)) * this.ratio)
}
// console.log('cj2024 calculatePlayerRect=====', width, height,px2vp(this.windowHeight),this.playerHeight)
... ...
... ... @@ -51,6 +51,7 @@ export struct WDPlayerRenderView {
@State videoRatio: number = 16 / 9
@State selfSize: Size = new Size('100%', '100%');
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@StorageProp('currentBreakpoint') @Watch("currentChanged") currentBreakpoint: string = 'sm';
@State isPad: boolean = this.currentBreakpoint == "md" || this.currentBreakpoint == "lg" ? true : false
// 是否上推视频中
... ... @@ -178,8 +179,8 @@ export struct WDPlayerRenderView {
playerHeight = width / ratio
} else {
// 否则高度撑满
playerHeight = height
playerWidth = height * ratio
playerHeight = height - (this.isPad?(this.topSafeHeight + this.bottomSafeHeight):0)
playerWidth = (height - (this.isPad?(this.topSafeHeight + this.bottomSafeHeight):0)) * ratio
}
// const height = info.size.width / ratio
... ...