chenqs
... ... @@ -2,6 +2,7 @@ import { ContentDetailDTO } from 'wdBean/Index';
import { DateTimeUtils, ToastUtils } from 'wdKit/Index';
import { PlayerConstants, WDPlayerController } from 'wdPlayer/Index';
@Reusable
@Component
export struct PlayerProgressView {
private playerController?: WDPlayerController;
... ... @@ -16,6 +17,7 @@ export struct PlayerProgressView {
@State showLoading: boolean = false
@Consume onlyWifiLoadVideo: boolean
timer: number = 0
aboutToAppear() {
if (this.playerController) {
this.playerController.onSeekDone = (status: number) => {
... ... @@ -28,10 +30,12 @@ export struct PlayerProgressView {
if (this.onlyWifiLoadVideo) {
this.showLoading = true
}
// console.log("PlayerProgressView11", this.timer)
if(this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
if (this.playerController?.getPlayer()) {
ToastUtils.shortToast('网络出小差了,请检查下网络')
}
ToastUtils.shortToast('网络出小差了,请检查下网络')
}, 10000)
} else {
clearTimeout(this.timer)
... ...