Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
王士厅
2024-09-23 17:59:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
43b950dc81a16f982a15c587c15eecbe8925379c
43b950dc
1 parent
72d6db1f
fix: 沉浸式播放时关闭网络,上滑视频,视频一直loading,恢复网络后,视频无法自动播放
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
3 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/PageComponent.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerProgressView.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/PageComponent.ets
View file @
43b950d
...
...
@@ -41,7 +41,7 @@ export struct PageComponent {
private pageTrackBean: PageTrackBean = new PageTrackBean()
// 国殇灰度管理
GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage')
@State netStatus: number | undefined = undefined // 存储网络状态
用来展示缺省图
@State netStatus: number | undefined = undefined // 存储网络状态
build() {
Column() {
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
View file @
43b950d
...
...
@@ -8,7 +8,7 @@ import {
postInteractBrowsOperateParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { HttpUtils } from 'wdNetwork/Index';
import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger, WindowModel } from 'wdKit/Index';
import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger,
NetworkType,
WindowModel } from 'wdKit/Index';
import { PlayerBottomView } from '../view/PlayerBottomView';
import { PlayerRightView } from '../view/PlayerRightView';
import { DisplayDirection } from 'wdConstant/Index';
...
...
@@ -61,6 +61,7 @@ export struct DetailPlayShortVideoPage {
@Consume toastTextVisible: boolean
@StorageProp('currentBreakpoint') @Watch("currentChanged") currentBreakpoint: string = 'sm';
@State isPad: boolean = this.currentBreakpoint == "md" || this.currentBreakpoint == "lg" ? true : false
@State timer: number = -1
currentChanged() {
if (this.currentBreakpoint == "md" || this.currentBreakpoint == "lg") {
...
...
@@ -230,6 +231,24 @@ export struct DetailPlayShortVideoPage {
///解决初始化竖屏视频时 this.ratio未更新导致显示错误
this.calculatePlayerRect()
// 注册监听网络连接
EmitterUtils.receiveEvent(EmitterEventId.NETWORK_CONNECTED, (async (str?: string) => {
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
let type: NetworkType | null = null
if (str) {
type = JSON.parse(str) as NetworkType
}
// 注册监听网络连接
if (this.currentIndex === this.index && type != NetworkType.TYPE_UNKNOWN) {
console.log(TAG, '网络连接状态变化', type, 'this.currentIndex', this.currentIndex, 'this.index', this.index)
this.currentIndexChange()
}
}, 1000)
}))
}
contentTrackingDict() {
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerProgressView.ets
View file @
43b950d
import { ContentDetailDTO } from 'wdBean/Index';
import { DateTimeUtils, ToastUtils } from 'wdKit/Index';
import { DateTimeUtils,
EmitterEventId, EmitterUtils,
ToastUtils } from 'wdKit/Index';
import { PlayerConstants, WDPlayerController } from 'wdPlayer/Index';
@Reusable
...
...
@@ -49,6 +49,12 @@ export struct PlayerProgressView {
this.playerController?.play()
}
}
// 注册监听网络连接
EmitterUtils.receiveEvent(EmitterEventId.NETWORK_CONNECTED, (async (str?: string) => {
if (this.timer) {
clearTimeout(this.timer)
}
}))
}
/**
...
...
Please
register
or
login
to post a comment