wangliang_wd

feat:优化文章详情页视频播放

... ... @@ -126,8 +126,20 @@ export struct WdWebLocalComponent {
if (this.videoUrl) {
Stack({ alignContent: Alignment.Bottom }) {
ForEach([this.videoUrl], (compIndex: number) => {
///解决播放器复用问题,后期优化(第二段视频播放器会先闪现第一段视频的画面)
ListItem() {
this.videoComp()
}
.onClick(() => {
if (this.progressOpacity <= 0) {
this.progressOpacity = 1
} else {
this.progressOpacity = 0
}
})
})
}
.width(this.positionWidth)
.height(this.positionHeight)
.alignRules({
... ... @@ -281,15 +293,6 @@ export struct WdWebLocalComponent {
WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT)
}
})
.onClick(() => {
// animateTo({duration: 1000}, () => {
if (this.progressOpacity <= 0) {
this.progressOpacity = 1
} else {
this.progressOpacity = 0
}
// })
})
if (this.isEndPlay){
Column(){
... ... @@ -307,6 +310,7 @@ export struct WdWebLocalComponent {
.width(this.positionWidth)
.height(this.positionHeight)
}else {
Column(){
Row() {
Image(this.isPause ? $r('app.media.icon_play') : $r('app.media.icon_pause'))
.interpolation(ImageInterpolation.Medium)
... ... @@ -346,6 +350,7 @@ export struct WdWebLocalComponent {
this.controller.setCurrentTime(value);
if (mode == SliderChangeMode.End) {
if (this.isPause) {
this.progressTimerNumber = 0
this.startPlay()
} else {
this.startProgressTimer()
... ... @@ -376,6 +381,10 @@ export struct WdWebLocalComponent {
.padding({left:16})
.alignItems(VerticalAlign.Center)
}
.justifyContent(FlexAlign.End)
.width(this.positionWidth)
.height(this.positionHeight)
}
}
}
... ...