王士厅

点播视频wifi状态优化

... ... @@ -58,6 +58,7 @@ export struct DetailPlayShortVideoPage {
PageName: string = ''
@State toastText: ResourceStr = "正在使用非WI-FI网络,播放将产生流量费用"
@Consume onlyWifiLoadVideo: boolean
@Consume toastTextVisible: boolean
/**
* 页面显示重查用户关注、点赞等信息
... ... @@ -169,9 +170,12 @@ export struct DetailPlayShortVideoPage {
}
async aboutToAppear() {
if(await onlyWifiLoadVideo()){
this.onlyWifiLoadVideo = true
if (!this.onlyWifiLoadVideo) {
this.onlyWifiLoadVideo = await onlyWifiLoadVideo()
this.toastTextVisible = this.onlyWifiLoadVideo ? false : true
console.log(TAG, 'this.onlyWifiLoadVideo', this.onlyWifiLoadVideo)
}
this.videoLandScape = this.contentDetailData.videoInfo[0]?.videoLandScape
this.ratio = (this.contentDetailData.videoInfo[0]?.resolutionWidth || 16) /
(this.contentDetailData.videoInfo[0]?.resolutionHeight || 9)
... ... @@ -280,7 +284,7 @@ export struct DetailPlayShortVideoPage {
playerController: this.playerController
})
if (!this.onlyWifiLoadVideo) {
if (this.toastTextVisible) {
this.buildContent()
}
... ... @@ -357,6 +361,7 @@ export struct DetailPlayShortVideoPage {
})
.onClick(() => {
this.onlyWifiLoadVideo = true
this.toastTextVisible = false
this.playerController?.play()
this.imageVisible = false
})
... ...
... ... @@ -40,6 +40,7 @@ export struct DetailVideoListPage {
pageShowTime:number = 0;
pageHideTime:number = 0;
@Provide onlyWifiLoadVideo: boolean = false
@Provide toastTextVisible: boolean = false
async aboutToAppear(): Promise<void> {
// 注册监听网络连接
... ...
... ... @@ -65,6 +65,7 @@ export struct VideoChannelDetail {
pageShowTime: number = 0;
pageHideTime: number = 0;
@Provide onlyWifiLoadVideo: boolean = false
@Provide toastTextVisible: boolean = false
autoRefreshChange() {
if (this.topNavIndex === 0 && !this.isRequesting) {
... ...
... ... @@ -13,7 +13,6 @@ export struct PlayerBottomView {
@Consume isDragging?: boolean
@Consume contentDetailData: ContentDetailDTO
@Consume displayDirection: DisplayDirection
@Consume onlyWifiLoadVideo: boolean
aboutToAppear(): void {
... ...