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
wangliang_wd
2024-10-23 09:43:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5b8997f415f38573d2fd9a7a4b93341e262d06e1
5b8997f4
1 parent
5d549337
feat:增加视频播放器重播UI
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
31 deletions
sight_harmony/features/wdComponent/src/main/ets/pages/VideoPlayPage.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_live_player_replay.png
sight_harmony/features/wdComponent/src/main/ets/pages/VideoPlayPage.ets
View file @
5b8997f
...
...
@@ -19,7 +19,7 @@ export struct VideoPlayPage {
@State totalTime: string = ''
@State progressVal: number = 0;
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State isPlayEnd: boolean = false
aboutToAppear(): void {
let par: Action = router.getParams() as Action
...
...
@@ -35,6 +35,9 @@ export struct VideoPlayPage {
this.playerController.onCanplay = () => {
this.playerController.play()
}
this.playerController.onStatusChange = (status: number) =>{
this.isPlayEnd = status === 5 ? true:false
}
}
build() {
...
...
@@ -55,6 +58,22 @@ export struct VideoPlayPage {
this.getTopUIComponent()
Stack()
.layoutWeight(1)
Column(){
Image($r('app.media.icon_live_player_replay')).width(40).height(40)
.onClick(() => {
this.progressVal = 0
this.isPlayEnd = false
this.playerController.firstPlay(this.videoUrl)
})
Text('重播').fontColor(Color.White).fontSize(14)
}
.justifyContent(FlexAlign.Center)
.backgroundColor("#80000000")
.width('100%')
.height('60%')
.visibility(this.isPlayEnd ? Visibility.Visible : Visibility.None)
Stack()
.layoutWeight(1)
this.getBottomUIComponent()
}
}
...
...
@@ -82,43 +101,42 @@ export struct VideoPlayPage {
.alignItems(VerticalAlign.Center)
.margin({ top: `${this.topSafeHeight}px` })
}.width('100%')
// .padding({
// top: 20,
// bottom: 6,
// left: 10,
// right: 10
// })
.alignItems(HorizontalAlign.Start)
}
@Builder
getBottomUIComponent() {
Row() {
this.playOrPauseBtn()
Text(this.currentTime)
.fontColor(Color.White)
.fontWeight(600)
.fontSize('12fp')
.margin({
left: 16
})
this.playProgressView()
Text(this.totalTime)
.fontColor(Color.White)
.fontWeight(600)
.fontSize('12fp')
.margin({
right: 16
})
Column(){
Row() {
this.playOrPauseBtn()
Text(this.currentTime)
.fontColor(Color.White)
.fontWeight(600)
.fontSize('12fp')
.margin({
left: 16
})
this.playProgressView()
Text(this.totalTime)
.fontColor(Color.White)
.fontWeight(600)
.fontSize('12fp')
.margin({
right: 16
})
}
.alignItems(VerticalAlign.Center)
.height(40)
.width('100%')
.visibility(this.isPlayEnd ? Visibility.None:Visibility.Visible)
.padding({
left: 10,
right: 10,
})
}
.alignItems(VerticalAlign.Center)
.align(Alignment.Top)
.height(64)
.width('100%')
.padding({
left: 10,
right: 10,
top: 15,
bottom: 15
})
}
@Builder
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_live_player_replay.png
0 → 100644
View file @
5b8997f
1.79 KB
Please
register
or
login
to post a comment