Showing
1 changed file
with
18 additions
and
9 deletions
| @@ -126,8 +126,20 @@ export struct WdWebLocalComponent { | @@ -126,8 +126,20 @@ export struct WdWebLocalComponent { | ||
| 126 | 126 | ||
| 127 | if (this.videoUrl) { | 127 | if (this.videoUrl) { |
| 128 | Stack({ alignContent: Alignment.Bottom }) { | 128 | Stack({ alignContent: Alignment.Bottom }) { |
| 129 | + ForEach([this.videoUrl], (compIndex: number) => { | ||
| 130 | + ///解决播放器复用问题,后期优化(第二段视频播放器会先闪现第一段视频的画面) | ||
| 131 | + ListItem() { | ||
| 129 | this.videoComp() | 132 | this.videoComp() |
| 130 | } | 133 | } |
| 134 | + .onClick(() => { | ||
| 135 | + if (this.progressOpacity <= 0) { | ||
| 136 | + this.progressOpacity = 1 | ||
| 137 | + } else { | ||
| 138 | + this.progressOpacity = 0 | ||
| 139 | + } | ||
| 140 | + }) | ||
| 141 | + }) | ||
| 142 | + } | ||
| 131 | .width(this.positionWidth) | 143 | .width(this.positionWidth) |
| 132 | .height(this.positionHeight) | 144 | .height(this.positionHeight) |
| 133 | .alignRules({ | 145 | .alignRules({ |
| @@ -281,15 +293,6 @@ export struct WdWebLocalComponent { | @@ -281,15 +293,6 @@ export struct WdWebLocalComponent { | ||
| 281 | WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT) | 293 | WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT) |
| 282 | } | 294 | } |
| 283 | }) | 295 | }) |
| 284 | - .onClick(() => { | ||
| 285 | - // animateTo({duration: 1000}, () => { | ||
| 286 | - if (this.progressOpacity <= 0) { | ||
| 287 | - this.progressOpacity = 1 | ||
| 288 | - } else { | ||
| 289 | - this.progressOpacity = 0 | ||
| 290 | - } | ||
| 291 | - // }) | ||
| 292 | - }) | ||
| 293 | 296 | ||
| 294 | if (this.isEndPlay){ | 297 | if (this.isEndPlay){ |
| 295 | Column(){ | 298 | Column(){ |
| @@ -307,6 +310,7 @@ export struct WdWebLocalComponent { | @@ -307,6 +310,7 @@ export struct WdWebLocalComponent { | ||
| 307 | .width(this.positionWidth) | 310 | .width(this.positionWidth) |
| 308 | .height(this.positionHeight) | 311 | .height(this.positionHeight) |
| 309 | }else { | 312 | }else { |
| 313 | + Column(){ | ||
| 310 | Row() { | 314 | Row() { |
| 311 | Image(this.isPause ? $r('app.media.icon_play') : $r('app.media.icon_pause')) | 315 | Image(this.isPause ? $r('app.media.icon_play') : $r('app.media.icon_pause')) |
| 312 | .interpolation(ImageInterpolation.Medium) | 316 | .interpolation(ImageInterpolation.Medium) |
| @@ -346,6 +350,7 @@ export struct WdWebLocalComponent { | @@ -346,6 +350,7 @@ export struct WdWebLocalComponent { | ||
| 346 | this.controller.setCurrentTime(value); | 350 | this.controller.setCurrentTime(value); |
| 347 | if (mode == SliderChangeMode.End) { | 351 | if (mode == SliderChangeMode.End) { |
| 348 | if (this.isPause) { | 352 | if (this.isPause) { |
| 353 | + this.progressTimerNumber = 0 | ||
| 349 | this.startPlay() | 354 | this.startPlay() |
| 350 | } else { | 355 | } else { |
| 351 | this.startProgressTimer() | 356 | this.startProgressTimer() |
| @@ -376,6 +381,10 @@ export struct WdWebLocalComponent { | @@ -376,6 +381,10 @@ export struct WdWebLocalComponent { | ||
| 376 | .padding({left:16}) | 381 | .padding({left:16}) |
| 377 | .alignItems(VerticalAlign.Center) | 382 | .alignItems(VerticalAlign.Center) |
| 378 | } | 383 | } |
| 384 | + .justifyContent(FlexAlign.End) | ||
| 385 | + .width(this.positionWidth) | ||
| 386 | + .height(this.positionHeight) | ||
| 387 | + } | ||
| 379 | } | 388 | } |
| 380 | 389 | ||
| 381 | } | 390 | } |
-
Please register or login to post a comment