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-10-12 10:09:38 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4299a4b48e0dbd9851f867595ba8d555b85760a9
4299a4b4
1 parent
cf8f34b2
fix: 横屏视频左侧上下滑动调节屏幕亮度,右侧上下滑动调节音量逻辑优化
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerFullScreenView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerFullScreenView.ets
View file @
4299a4b
...
...
@@ -18,6 +18,7 @@ export struct PlayerFullScreenView {
@State videoDuration: number = this.contentDetailData?.videoInfo?.[0]?.videoDuration || 1
@State showOperator: boolean = true
private timer: number = -1
private debounceTimer: number = -1
@State upProVal: string = ''
@State duration: string = DateTimeUtils.secondToTime(this.videoDuration)
@State startX: number = 0
...
...
@@ -80,6 +81,13 @@ export struct PlayerFullScreenView {
}, 5000)
}
debounce(func: () => void, wait: number) {
if (this.debounceTimer) {
clearTimeout(this.debounceTimer);
}
this.debounceTimer = setTimeout(func, wait);
}
build() {
Stack({ alignContent: Alignment.Center }) {
Row() {
...
...
@@ -121,7 +129,7 @@ export struct PlayerFullScreenView {
.gesture(
PanGesture(this.panOptionBright)
.onActionStart((event?: GestureEvent) => {
console.log(TAG, 'onActionEnd this.panOptionBright')
//
console.log(TAG, 'onActionEnd this.panOptionBright')
this.isShowBright = true
this.playerController?.onBrightActionStart(event!);
})
...
...
@@ -129,9 +137,9 @@ export struct PlayerFullScreenView {
this.playerController?.onBrightActionUpdate(event!);
})
.onActionEnd(() => {
setTimeout(() => {
this.isShowBright = false
}, 500)
this.debounce(() => {
this.isShowBright = false;
}, 1000);
this.playerController?.onActionEnd();
})
)
...
...
@@ -154,9 +162,9 @@ export struct PlayerFullScreenView {
this.playerController?.onVolumeActionUpdate(event!);
})
.onActionEnd(() => {
setTimeout(() => {
this.isShowVolume = false
}, 500)
this.debounce(() => {
this.isShowVolume = false;
}, 1000);
this.playerController?.onActionEnd();
})
)
...
...
Please
register
or
login
to post a comment