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-07-23 18:23:17 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
99a54dbc2c70d1d07c6ec623f30d71246860ed14
99a54dbc
1 parent
de786b4c
fix: 加载场景-进度加载_视频加载>加载中切断网络页面报错
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerProgressView.ets
sight_harmony/features/wdPlayer/src/main/ets/controller/WDPlayerController.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerProgressView.ets
View file @
99a54db
import { ContentDetailDTO } from 'wdBean/Index';
import { DateTimeUtils } from 'wdKit/Index';
import { DateTimeUtils
, ToastUtils
} from 'wdKit/Index';
import { PlayerConstants, WDPlayerController } from 'wdPlayer/Index';
@Component
...
...
@@ -15,6 +15,7 @@ export struct PlayerProgressView {
@State loadingWidth: number | string = 1
@State showLoading: boolean = false
@Consume onlyWifiLoadVideo: boolean
timer: number = 0
aboutToAppear() {
if (this.playerController) {
this.playerController.onSeekDone = (status: number) => {
...
...
@@ -27,7 +28,11 @@ export struct PlayerProgressView {
if (this.onlyWifiLoadVideo) {
this.showLoading = true
}
this.timer = setTimeout(() => {
ToastUtils.shortToast('网络出小差了,请检查下网络')
}, 10000)
} else {
clearTimeout(this.timer)
this.loadingWidth = 1
this.showLoading = false
}
...
...
sight_harmony/features/wdPlayer/src/main/ets/controller/WDPlayerController.ets
View file @
99a54db
...
...
@@ -156,7 +156,7 @@ export class WDPlayerController {
this.initProgress(time);
});
this.avPlayer?.on(Events.ERROR, (error) => {
this.playError(error.message);
//
this.playError(error.message);
Logger.error(TAG, '播放错误' + JSON.stringify(error))
TrackingPlay.videoPlayError(error.message, this.pageName, this.pageName, this.pageParam)
})
...
...
@@ -448,20 +448,20 @@ export class WDPlayerController {
Logger.debug(TAG, 'watchStatus ' + this.status)
if(this.status == PlayerConstants.STATUS_START){
Logger.debug(TAG, '播放视频')
Logger.debug(TAG, '播放视频prepareTime' + JSON.stringify(this.prepareTime))
Logger.debug(TAG, '播放视频pageName' + JSON.stringify(this.pageName))
Logger.debug(TAG, '播放视频pageParam' + JSON.stringify(this.pageParam))
// Logger.debug(TAG, '播放视频')
// Logger.debug(TAG, '播放视频prepareTime' + JSON.stringify(this.prepareTime))
// Logger.debug(TAG, '播放视频pageName' + JSON.stringify(this.pageName))
// Logger.debug(TAG, '播放视频pageParam' + JSON.stringify(this.pageParam))
// 播放埋点
TrackingPlay.videoPositivePlay(Number(this.prepareTime),this.pageName, this.pageName, this.pageParam)
}
if(this.status == PlayerConstants.STATUS_COMPLETION){
let initDuration = Math.floor(Number(this.duration)/1000)
Logger.debug(TAG, '播放结束')
Logger.debug(TAG, '播放结束currentPlayTime' + JSON.stringify(this.currentPlayTime))
Logger.debug(TAG, '播放结束initDuration' + JSON.stringify(initDuration))
Logger.debug(TAG, '播放结束pageName' + JSON.stringify(this.pageName))
Logger.debug(TAG, '播放结束pageParam' + JSON.stringify(this.pageParam))
// Logger.debug(TAG, '播放结束')
// Logger.debug(TAG, '播放结束currentPlayTime' + JSON.stringify(this.currentPlayTime))
// Logger.debug(TAG, '播放结束initDuration' + JSON.stringify(initDuration))
// Logger.debug(TAG, '播放结束pageName' + JSON.stringify(this.pageName))
// Logger.debug(TAG, '播放结束pageParam' + JSON.stringify(this.pageParam))
// 播放结束埋点
TrackingPlay.videoPlayEnd(this.currentPlayTime, initDuration, this.currentPlayTime, this.pageName, this.pageName, this.pageParam)
}
...
...
Please
register
or
login
to post a comment