王士厅

fix: 进入视频详情,点击全屏按钮,进入全屏,拖动精度条。拖动的数和底部的精度不一样

... ... @@ -10,13 +10,15 @@ import { window } from '@kit.ArkUI'
export struct PlayerFullScreenView {
private playerController?: WDPlayerController;
@Consume contentDetailData: ContentDetailDTO
@Consume progressVal: number;
@Consume @Watch("updateProgress") progressVal: number;
@Consume status: number
@Consume displayDirection: DisplayDirection
@Consume isDragging: boolean
@State videoDuration: number = this.contentDetailData?.videoInfo?.[0]?.videoDuration || 1
@State showOperator: boolean = true
private timer: number = -1
@State upProVal: string = ''
@State duration: string = DateTimeUtils.secondToTime(this.videoDuration)
getTitle() {
return this.contentDetailData?.newsTitle
... ... @@ -27,11 +29,17 @@ export struct PlayerFullScreenView {
WDShare.shareContent(this.contentDetailData)
}
updateProgress() {
this.upProVal = DateTimeUtils.secondToTime(Math.floor((this.progressVal / 100 * this.videoDuration)))
}
aboutToAppear(): void {
WindowModel.shared.setWindowSystemBarEnable([])
this.timer = setInterval(() => {
this.showOperator = false
}, 5000)
// 初始显示
this.updateProgress()
}
aboutToDisappear(): void {
... ... @@ -108,14 +116,15 @@ export struct PlayerFullScreenView {
})
}
@Builder
bottomBuilder() {
Column() {
Text() {
Span(DateTimeUtils.secondToTime(Math.floor(this.progressVal / 100 * this.videoDuration)))
Span(this.upProVal)
Span(' / ')
Span(DateTimeUtils.secondToTime(this.videoDuration))
Span(this.duration)
}
.fontSize(24)
.fontColor(Color.White)
... ... @@ -135,7 +144,7 @@ export struct PlayerFullScreenView {
this.playerController?.switchPlayOrPause()
})
Text(DateTimeUtils.secondToTime(Math.ceil((this.progressVal / 100 * this.videoDuration))))
Text(this.upProVal)
.fontSize(12)
.fontWeight(600)
.fontColor(Color.White)
... ... @@ -153,7 +162,7 @@ export struct PlayerFullScreenView {
}
})
Text(DateTimeUtils.secondToTime(this.videoDuration))
Text(this.duration)
.fontSize(12)
.fontWeight(600)
.fontColor(Color.White)
... ...