Showing
1 changed file
with
11 additions
and
6 deletions
| @@ -10,6 +10,7 @@ export struct PlayerProgressView { | @@ -10,6 +10,7 @@ export struct PlayerProgressView { | ||
| 10 | @Consume isOpenDetail: boolean | 10 | @Consume isOpenDetail: boolean |
| 11 | @Consume isDragging: boolean | 11 | @Consume isDragging: boolean |
| 12 | @State status: number = PlayerConstants.STATUS_START; | 12 | @State status: number = PlayerConstants.STATUS_START; |
| 13 | + @State videoDuration: number = this.contentDetailData?.videoInfo?.[0]?.videoDuration || 1 | ||
| 13 | 14 | ||
| 14 | aboutToAppear() { | 15 | aboutToAppear() { |
| 15 | if (this.playerController) { | 16 | if (this.playerController) { |
| @@ -25,9 +26,9 @@ export struct PlayerProgressView { | @@ -25,9 +26,9 @@ export struct PlayerProgressView { | ||
| 25 | build() { | 26 | build() { |
| 26 | Column() { | 27 | Column() { |
| 27 | Text() { | 28 | Text() { |
| 28 | - Span(DateTimeUtils.secondToTime(Math.floor(this.progressVal / 100 * this.contentDetailData.videoInfo[0].videoDuration))) | 29 | + Span(DateTimeUtils.secondToTime(Math.floor(this.progressVal / 100 * this.videoDuration))) |
| 29 | Span(' / ') | 30 | Span(' / ') |
| 30 | - Span(DateTimeUtils.secondToTime(this.contentDetailData.videoInfo[0].videoDuration || 0)) | 31 | + Span(DateTimeUtils.secondToTime(this.videoDuration)) |
| 31 | } | 32 | } |
| 32 | .fontSize(24) | 33 | .fontSize(24) |
| 33 | .fontColor(Color.White) | 34 | .fontColor(Color.White) |
| @@ -40,12 +41,16 @@ export struct PlayerProgressView { | @@ -40,12 +41,16 @@ export struct PlayerProgressView { | ||
| 40 | step: 0.01, | 41 | step: 0.01, |
| 41 | // style: SliderStyle.OutSet | 42 | // style: SliderStyle.OutSet |
| 42 | }) | 43 | }) |
| 43 | - .blockColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? $r('app.color.play_block_color') : Color.Transparent) | ||
| 44 | - .trackColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? $r('app.color.pause_track_color') : $r('app.color.play_track_color')) | ||
| 45 | - .selectedColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? $r('app.color.pause_selected_color') : $r('app.color.play_selected_color')) | 44 | + .blockColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? $r('app.color.play_block_color') : |
| 45 | + Color.Transparent) | ||
| 46 | + .trackColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? | ||
| 47 | + $r('app.color.pause_track_color') : $r('app.color.play_track_color')) | ||
| 48 | + .selectedColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? | ||
| 49 | + $r('app.color.pause_selected_color') : $r('app.color.play_selected_color')) | ||
| 46 | .trackThickness(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? 4 : 1) | 50 | .trackThickness(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? 4 : 1) |
| 47 | .blockStyle({ | 51 | .blockStyle({ |
| 48 | - type: this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? SliderBlockType.IMAGE : SliderBlockType.DEFAULT, | 52 | + type: this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? SliderBlockType.IMAGE : |
| 53 | + SliderBlockType.DEFAULT, | ||
| 49 | image: $r('app.media.ic_player_block') | 54 | image: $r('app.media.ic_player_block') |
| 50 | }) | 55 | }) |
| 51 | .blockSize({ width: 18, height: 12 }) | 56 | .blockSize({ width: 18, height: 12 }) |
-
Please register or login to post a comment