Showing
1 changed file
with
8 additions
and
4 deletions
| @@ -245,6 +245,13 @@ export struct DetailPlayShortVideoPage { | @@ -245,6 +245,13 @@ export struct DetailPlayShortVideoPage { | ||
| 245 | // 注册监听网络连接 | 245 | // 注册监听网络连接 |
| 246 | if (this.currentIndex === this.index && type != NetworkType.TYPE_UNKNOWN) { | 246 | if (this.currentIndex === this.index && type != NetworkType.TYPE_UNKNOWN) { |
| 247 | console.log(TAG, '网络连接状态变化', type, 'this.currentIndex', this.currentIndex, 'this.index', this.index) | 247 | console.log(TAG, '网络连接状态变化', type, 'this.currentIndex', this.currentIndex, 'this.index', this.index) |
| 248 | + if(type == NetworkType.TYPE_CELLULAR) { | ||
| 249 | + this.toastTextVisible = true | ||
| 250 | + this.onlyWifiLoadVideo = false | ||
| 251 | + } else if(type == NetworkType.TYPE_WIFI) { | ||
| 252 | + this.toastTextVisible = false | ||
| 253 | + this.onlyWifiLoadVideo = true | ||
| 254 | + } | ||
| 248 | this.currentIndexChange() | 255 | this.currentIndexChange() |
| 249 | } | 256 | } |
| 250 | }, 1000) | 257 | }, 1000) |
| @@ -426,10 +433,7 @@ export struct DetailPlayShortVideoPage { | @@ -426,10 +433,7 @@ export struct DetailPlayShortVideoPage { | ||
| 426 | .onClick(() => { | 433 | .onClick(() => { |
| 427 | this.onlyWifiLoadVideo = true | 434 | this.onlyWifiLoadVideo = true |
| 428 | this.toastTextVisible = false | 435 | this.toastTextVisible = false |
| 429 | - this.playerController?.play() | ||
| 430 | - this.playerController.startRenderFrame(() => { | ||
| 431 | - this.imageVisible = false | ||
| 432 | - }) | 436 | + this.currentIndexChange() |
| 433 | }) | 437 | }) |
| 434 | } | 438 | } |
| 435 | .width('100%') | 439 | .width('100%') |
-
Please register or login to post a comment