Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhenghy
2024-05-10 11:17:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bccf271dfcce6aa82b86d6561115c56ec7c61c59
bccf271d
1 parent
bc188821
修复视频崩溃
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerProgressView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerProgressView.ets
View file @
bccf271
...
...
@@ -10,6 +10,7 @@ export struct PlayerProgressView {
@Consume isOpenDetail: boolean
@Consume isDragging: boolean
@State status: number = PlayerConstants.STATUS_START;
@State videoDuration: number = this.contentDetailData?.videoInfo?.[0]?.videoDuration || 1
aboutToAppear() {
if (this.playerController) {
...
...
@@ -25,9 +26,9 @@ export struct PlayerProgressView {
build() {
Column() {
Text() {
Span(DateTimeUtils.secondToTime(Math.floor(this.progressVal / 100 * this.
contentDetailData.videoInfo[0].
videoDuration)))
Span(DateTimeUtils.secondToTime(Math.floor(this.progressVal / 100 * this.videoDuration)))
Span(' / ')
Span(DateTimeUtils.secondToTime(this.
contentDetailData.videoInfo[0].videoDuration || 0
))
Span(DateTimeUtils.secondToTime(this.
videoDuration
))
}
.fontSize(24)
.fontColor(Color.White)
...
...
@@ -40,12 +41,16 @@ export struct PlayerProgressView {
step: 0.01,
// style: SliderStyle.OutSet
})
.blockColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? $r('app.color.play_block_color') : Color.Transparent)
.trackColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? $r('app.color.pause_track_color') : $r('app.color.play_track_color'))
.selectedColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? $r('app.color.pause_selected_color') : $r('app.color.play_selected_color'))
.blockColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? $r('app.color.play_block_color') :
Color.Transparent)
.trackColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ?
$r('app.color.pause_track_color') : $r('app.color.play_track_color'))
.selectedColor(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ?
$r('app.color.pause_selected_color') : $r('app.color.play_selected_color'))
.trackThickness(this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? 4 : 1)
.blockStyle({
type: this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? SliderBlockType.IMAGE : SliderBlockType.DEFAULT,
type: this.status === PlayerConstants.STATUS_PAUSE || this.isDragging ? SliderBlockType.IMAGE :
SliderBlockType.DEFAULT,
image: $r('app.media.ic_player_block')
})
.blockSize({ width: 18, height: 12 })
...
...
Please
register
or
login
to post a comment