Showing
3 changed files
with
34 additions
and
6 deletions
| @@ -8,7 +8,7 @@ import { | @@ -8,7 +8,7 @@ import { | ||
| 8 | postInteractBrowsOperateParams | 8 | postInteractBrowsOperateParams |
| 9 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | 9 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; |
| 10 | import { HttpUtils } from 'wdNetwork/Index'; | 10 | import { HttpUtils } from 'wdNetwork/Index'; |
| 11 | -import { DateTimeUtils, WindowModel } from 'wdKit/Index'; | 11 | +import { DateTimeUtils, Logger, WindowModel } from 'wdKit/Index'; |
| 12 | import { PlayerBottomView } from '../view/PlayerBottomView'; | 12 | import { PlayerBottomView } from '../view/PlayerBottomView'; |
| 13 | import { PlayerRightView } from '../view/PlayerRightView'; | 13 | import { PlayerRightView } from '../view/PlayerRightView'; |
| 14 | import { DisplayDirection } from 'wdConstant/Index'; | 14 | import { DisplayDirection } from 'wdConstant/Index'; |
| @@ -229,7 +229,7 @@ export struct DetailPlayShortVideoPage { | @@ -229,7 +229,7 @@ export struct DetailPlayShortVideoPage { | ||
| 229 | showCommentListChanged() { | 229 | showCommentListChanged() { |
| 230 | if (this.showCommentList) { | 230 | if (this.showCommentList) { |
| 231 | this.playerWidth = px2vp(this.windowWidth) | 231 | this.playerWidth = px2vp(this.windowWidth) |
| 232 | - this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0) | 232 | + // this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0) |
| 233 | } else { | 233 | } else { |
| 234 | this.calculatePlayerRect() | 234 | this.calculatePlayerRect() |
| 235 | } | 235 | } |
| @@ -245,6 +245,11 @@ export struct DetailPlayShortVideoPage { | @@ -245,6 +245,11 @@ export struct DetailPlayShortVideoPage { | ||
| 245 | showCommentList: $showCommentList, | 245 | showCommentList: $showCommentList, |
| 246 | publishCommentModel: $publishCommentModel, | 246 | publishCommentModel: $publishCommentModel, |
| 247 | interactData: $interactData, | 247 | interactData: $interactData, |
| 248 | + onHeightDidChange: (height: number) => { | ||
| 249 | + this.playerWidth = px2vp(this.windowWidth) | ||
| 250 | + this.playerHeight = px2vp(this.windowHeight - height) | ||
| 251 | + Logger.debug(TAG, "height: " + px2vp(height) + " ===> 视频高度: " + this.playerHeight + " window height: " + px2vp(this.windowHeight)) | ||
| 252 | + } | ||
| 248 | }) | 253 | }) |
| 249 | this.playerViewBuilder() | 254 | this.playerViewBuilder() |
| 250 | 255 | ||
| @@ -338,7 +343,7 @@ export struct DetailPlayShortVideoPage { | @@ -338,7 +343,7 @@ export struct DetailPlayShortVideoPage { | ||
| 338 | 343 | ||
| 339 | // 横屏-全屏观看 | 344 | // 横屏-全屏观看 |
| 340 | // 点击查看详情 不展示 | 345 | // 点击查看详情 不展示 |
| 341 | - if (this.videoLandScape === 1 && !this.isOpenDetail && this.displayDirection === DisplayDirection.VERTICAL) { | 346 | + if (this.videoLandScape === 1 && !this.isOpenDetail && this.displayDirection === DisplayDirection.VERTICAL && !this.showCommentList) { |
| 342 | this.playerFullscreenBuilder() | 347 | this.playerFullscreenBuilder() |
| 343 | } | 348 | } |
| 344 | 349 |
| @@ -12,6 +12,7 @@ export struct CommentDialogView { | @@ -12,6 +12,7 @@ export struct CommentDialogView { | ||
| 12 | @Link interactData: InteractDataDTO | 12 | @Link interactData: InteractDataDTO |
| 13 | @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO | 13 | @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO |
| 14 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) | 14 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) |
| 15 | + onHeightDidChange?: Callback<number> | ||
| 15 | 16 | ||
| 16 | @State @Watch("innerShowCommentChange") innerShowComment: boolean = false | 17 | @State @Watch("innerShowCommentChange") innerShowComment: boolean = false |
| 17 | 18 | ||
| @@ -38,7 +39,8 @@ export struct CommentDialogView { | @@ -38,7 +39,8 @@ export struct CommentDialogView { | ||
| 38 | if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) { | 39 | if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) { |
| 39 | this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer) | 40 | this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer) |
| 40 | } | 41 | } |
| 41 | - } | 42 | + }, |
| 43 | + onHeightDidChange: this.onHeightDidChange | ||
| 42 | }) | 44 | }) |
| 43 | } | 45 | } |
| 44 | } | 46 | } |
| @@ -141,7 +141,27 @@ export struct WDPlayerRenderView { | @@ -141,7 +141,27 @@ export struct WDPlayerRenderView { | ||
| 141 | 141 | ||
| 142 | this.xComponentController.setXComponentSurfaceRect({ | 142 | this.xComponentController.setXComponentSurfaceRect({ |
| 143 | surfaceWidth: info.size.height * ratio, | 143 | surfaceWidth: info.size.height * ratio, |
| 144 | - surfaceHeight: info.size.height | 144 | + surfaceHeight: info.size.height, |
| 145 | + offsetY: 0 | ||
| 146 | + }); | ||
| 147 | + return | ||
| 148 | + } | ||
| 149 | + } else { | ||
| 150 | + // 横屏 | ||
| 151 | + let ratio = this.videoWidth / this.videoHeight | ||
| 152 | + const height = info.size.width / ratio | ||
| 153 | + | ||
| 154 | + // 横屏,缩放高度小 视频区域高度 | ||
| 155 | + if (height < info.size.height) { | ||
| 156 | + | ||
| 157 | + Logger.debug(TAG, "ratio = " + ratio + " ==> new height = " + height) | ||
| 158 | + | ||
| 159 | + Logger.debug(TAG, "宽度固定,求高度: " + height) | ||
| 160 | + | ||
| 161 | + this.xComponentController.setXComponentSurfaceRect({ | ||
| 162 | + surfaceWidth: info.size.width, | ||
| 163 | + surfaceHeight: height, | ||
| 164 | + offsetY: (info.size.height - height) / 2 | ||
| 145 | }); | 165 | }); |
| 146 | return | 166 | return |
| 147 | } | 167 | } |
| @@ -149,7 +169,8 @@ export struct WDPlayerRenderView { | @@ -149,7 +169,8 @@ export struct WDPlayerRenderView { | ||
| 149 | 169 | ||
| 150 | this.xComponentController.setXComponentSurfaceRect({ | 170 | this.xComponentController.setXComponentSurfaceRect({ |
| 151 | surfaceWidth: info.size.width, | 171 | surfaceWidth: info.size.width, |
| 152 | - surfaceHeight: info.size.height | 172 | + surfaceHeight: info.size.height, |
| 173 | + offsetY: 0 | ||
| 153 | }); | 174 | }); |
| 154 | } | 175 | } |
| 155 | 176 |
-
Please register or login to post a comment