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-08-06 13:57:27 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6fa22cd6336392eb95d91a991be06886ef0bdcef
6fa22cd6
1 parent
5dde410e
feat:增加动态详情页重播展示
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
45 deletions
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebLocalComponent.ets
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebLocalComponent.ets
View file @
6fa22cd
...
...
@@ -35,6 +35,7 @@ export struct WdWebLocalComponent {
@StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
@State isFullScreen: boolean = false;
@State isEndPlay: boolean = false;
currentChanged(){
///折叠屏转换 暂停播放器
this.controller.pause()
...
...
@@ -213,6 +214,9 @@ export struct WdWebLocalComponent {
.controls(this.isFullScreen?true:false)
.autoPlay(true)
.objectFit(ImageFit.Contain)
.onFinish(()=>{
this.isEndPlay = true
})
.onStart(() => {
this.isPause = false
})
...
...
@@ -239,57 +243,75 @@ export struct WdWebLocalComponent {
WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT)
}
})
Row() {
Image(this.isPause ? $r('app.media.icon_play') : $r('app.media.icon_pause'))
.width(24)
.height(24)
.onClick(() => {
if (this.isPause) {
if (this.isEndPlay){
Column(){
Image($r('app.media.icon_replay')).width(40).height(40)
.onClick(() => {
this.isEndPlay = false
this.controller.start()
} else {
this.controller.pause()
}
})
Row() {
Text(DateTimeUtils.getFormattedDuration(this.currentTime * 1000))
.fontSize(12)
.fontColor(Color.White)
.fontWeight(600)
Slider({
value: this.currentTime,
min: 0,
max: this.durationTime
})
.width("50%")
.selectedColor('#ED2800')
.trackColor("#1AFFFFFF")
.trackThickness(2)
.margin({ left: 4, right: 4 })
.blockStyle({
type: SliderBlockType.IMAGE,
image: $r('app.media.slider_block')
})
.blockSize({ width: 18, height: 12 })
.onChange((value: number, mode: SliderChangeMode) => {
this.controller.setCurrentTime(value);
})
Text(DateTimeUtils.getFormattedDuration(this.durationTime * 1000))
.fontSize(12)
.fontColor(Color.White)
.fontWeight(600)
Text('重播').fontColor(Color.White).fontSize(14)
}
.backgroundColor(Color.Black)
.opacity(0.5)
.justifyContent(FlexAlign.Center)
.width(this.positionWidth)
.height(this.positionHeight)
}else {
Row() {
Image(this.isPause ? $r('app.media.icon_play') : $r('app.media.icon_pause'))
.width(24)
.height(24)
.onClick(() => {
if (this.isPause) {
this.controller.start()
} else {
this.controller.pause()
}
})
Row() {
Text(DateTimeUtils.getFormattedDuration(this.currentTime * 1000))
.fontSize(12)
.fontColor(Color.White)
.fontWeight(600)
Slider({
value: this.currentTime,
min: 0,
max: this.durationTime
})
.width("50%")
.selectedColor('#ED2800')
.trackColor("#1AFFFFFF")
.trackThickness(2)
.margin({ left: 4, right: 4 })
.blockStyle({
type: SliderBlockType.IMAGE,
image: $r('app.media.slider_block')
})
.blockSize({ width: 18, height: 12 })
.onChange((value: number, mode: SliderChangeMode) => {
this.controller.setCurrentTime(value);
})
Text(DateTimeUtils.getFormattedDuration(this.durationTime * 1000))
.fontSize(12)
.fontColor(Color.White)
.fontWeight(600)
}
.justifyContent(FlexAlign.Center)
// Image($r('app.media.icon_full_screen'))
// .width(24)
// .height(24)
// .onClick(() => {
// this.controller.requestFullscreen(true)
// })
// Image($r('app.media.icon_full_screen'))
// .width(24)
// .height(24)
// .onClick(() => {
// this.controller.requestFullscreen(true)
// })
}
.opacity(0.8)
.width("100%")
.justifyContent(FlexAlign.SpaceAround)
}
.opacity(0.8)
.width("100%")
.justifyContent(FlexAlign.SpaceAround)
}
}
...
...
Please
register
or
login
to post a comment