Showing
1 changed file
with
22 additions
and
0 deletions
| @@ -35,6 +35,7 @@ export struct WdWebLocalComponent { | @@ -35,6 +35,7 @@ export struct WdWebLocalComponent { | ||
| 35 | @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm'; | 35 | @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm'; |
| 36 | 36 | ||
| 37 | @State isFullScreen: boolean = false; | 37 | @State isFullScreen: boolean = false; |
| 38 | + @State isEndPlay: boolean = false; | ||
| 38 | currentChanged(){ | 39 | currentChanged(){ |
| 39 | ///折叠屏转换 暂停播放器 | 40 | ///折叠屏转换 暂停播放器 |
| 40 | this.controller.pause() | 41 | this.controller.pause() |
| @@ -213,6 +214,9 @@ export struct WdWebLocalComponent { | @@ -213,6 +214,9 @@ export struct WdWebLocalComponent { | ||
| 213 | .controls(this.isFullScreen?true:false) | 214 | .controls(this.isFullScreen?true:false) |
| 214 | .autoPlay(true) | 215 | .autoPlay(true) |
| 215 | .objectFit(ImageFit.Contain) | 216 | .objectFit(ImageFit.Contain) |
| 217 | + .onFinish(()=>{ | ||
| 218 | + this.isEndPlay = true | ||
| 219 | + }) | ||
| 216 | .onStart(() => { | 220 | .onStart(() => { |
| 217 | this.isPause = false | 221 | this.isPause = false |
| 218 | }) | 222 | }) |
| @@ -239,6 +243,23 @@ export struct WdWebLocalComponent { | @@ -239,6 +243,23 @@ export struct WdWebLocalComponent { | ||
| 239 | WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT) | 243 | WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT) |
| 240 | } | 244 | } |
| 241 | }) | 245 | }) |
| 246 | + | ||
| 247 | + if (this.isEndPlay){ | ||
| 248 | + Column(){ | ||
| 249 | + Image($r('app.media.icon_replay')).width(40).height(40) | ||
| 250 | + .onClick(() => { | ||
| 251 | + this.isEndPlay = false | ||
| 252 | + this.controller.start() | ||
| 253 | + }) | ||
| 254 | + | ||
| 255 | + Text('重播').fontColor(Color.White).fontSize(14) | ||
| 256 | + } | ||
| 257 | + .backgroundColor(Color.Black) | ||
| 258 | + .opacity(0.5) | ||
| 259 | + .justifyContent(FlexAlign.Center) | ||
| 260 | + .width(this.positionWidth) | ||
| 261 | + .height(this.positionHeight) | ||
| 262 | + }else { | ||
| 242 | Row() { | 263 | Row() { |
| 243 | Image(this.isPause ? $r('app.media.icon_play') : $r('app.media.icon_pause')) | 264 | Image(this.isPause ? $r('app.media.icon_play') : $r('app.media.icon_pause')) |
| 244 | .width(24) | 265 | .width(24) |
| @@ -291,6 +312,7 @@ export struct WdWebLocalComponent { | @@ -291,6 +312,7 @@ export struct WdWebLocalComponent { | ||
| 291 | .width("100%") | 312 | .width("100%") |
| 292 | .justifyContent(FlexAlign.SpaceAround) | 313 | .justifyContent(FlexAlign.SpaceAround) |
| 293 | } | 314 | } |
| 315 | + } | ||
| 294 | 316 | ||
| 295 | } | 317 | } |
| 296 | 318 |
-
Please register or login to post a comment