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
xugenyuan
2024-06-07 20:17:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
be64d3946675552d820c9da7e2f72932bf1b03b2
be64d394
1 parent
f32c540f
ref |> 视频详情页评论弹框改为半模态弹框,视频上推效果
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
6 deletions
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/CommentDialogView.ets
sight_harmony/features/wdPlayer/src/main/ets/pages/WDPlayerRenderView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
View file @
be64d39
...
...
@@ -8,7 +8,7 @@ import {
postInteractBrowsOperateParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { HttpUtils } from 'wdNetwork/Index';
import { DateTimeUtils, WindowModel } from 'wdKit/Index';
import { DateTimeUtils,
Logger,
WindowModel } from 'wdKit/Index';
import { PlayerBottomView } from '../view/PlayerBottomView';
import { PlayerRightView } from '../view/PlayerRightView';
import { DisplayDirection } from 'wdConstant/Index';
...
...
@@ -229,7 +229,7 @@ export struct DetailPlayShortVideoPage {
showCommentListChanged() {
if (this.showCommentList) {
this.playerWidth = px2vp(this.windowWidth)
this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0)
//
this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0)
} else {
this.calculatePlayerRect()
}
...
...
@@ -245,6 +245,11 @@ export struct DetailPlayShortVideoPage {
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel,
interactData: $interactData,
onHeightDidChange: (height: number) => {
this.playerWidth = px2vp(this.windowWidth)
this.playerHeight = px2vp(this.windowHeight - height)
Logger.debug(TAG, "height: " + px2vp(height) + " ===> 视频高度: " + this.playerHeight + " window height: " + px2vp(this.windowHeight))
}
})
this.playerViewBuilder()
...
...
@@ -338,7 +343,7 @@ export struct DetailPlayShortVideoPage {
// 横屏-全屏观看
// 点击查看详情 不展示
if (this.videoLandScape === 1 && !this.isOpenDetail && this.displayDirection === DisplayDirection.VERTICAL) {
if (this.videoLandScape === 1 && !this.isOpenDetail && this.displayDirection === DisplayDirection.VERTICAL
&& !this.showCommentList
) {
this.playerFullscreenBuilder()
}
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/CommentDialogView.ets
View file @
be64d39
...
...
@@ -12,6 +12,7 @@ export struct CommentDialogView {
@Link interactData: InteractDataDTO
@State fakePageInfo: PageInfoDTO = {} as PageInfoDTO
@State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
onHeightDidChange?: Callback<number>
@State @Watch("innerShowCommentChange") innerShowComment: boolean = false
...
...
@@ -38,7 +39,8 @@ export struct CommentDialogView {
if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) {
this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer)
}
}
},
onHeightDidChange: this.onHeightDidChange
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdPlayer/src/main/ets/pages/WDPlayerRenderView.ets
View file @
be64d39
...
...
@@ -141,7 +141,27 @@ export struct WDPlayerRenderView {
this.xComponentController.setXComponentSurfaceRect({
surfaceWidth: info.size.height * ratio,
surfaceHeight: info.size.height
surfaceHeight: info.size.height,
offsetY: 0
});
return
}
} else {
// 横屏
let ratio = this.videoWidth / this.videoHeight
const height = info.size.width / ratio
// 横屏,缩放高度小 视频区域高度
if (height < info.size.height) {
Logger.debug(TAG, "ratio = " + ratio + " ==> new height = " + height)
Logger.debug(TAG, "宽度固定,求高度: " + height)
this.xComponentController.setXComponentSurfaceRect({
surfaceWidth: info.size.width,
surfaceHeight: height,
offsetY: (info.size.height - height) / 2
});
return
}
...
...
@@ -149,7 +169,8 @@ export struct WDPlayerRenderView {
this.xComponentController.setXComponentSurfaceRect({
surfaceWidth: info.size.width,
surfaceHeight: info.size.height
surfaceHeight: info.size.height,
offsetY: 0
});
}
...
...
Please
register
or
login
to post a comment