wangliang_wd

feat:增加动态详情页重播展示

... ... @@ -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,6 +243,23 @@ export struct WdWebLocalComponent {
WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT)
}
})
if (this.isEndPlay){
Column(){
Image($r('app.media.icon_replay')).width(40).height(40)
.onClick(() => {
this.isEndPlay = false
this.controller.start()
})
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)
... ... @@ -291,6 +312,7 @@ export struct WdWebLocalComponent {
.width("100%")
.justifyContent(FlexAlign.SpaceAround)
}
}
}
... ...