王士厅
@@ -5,7 +5,7 @@ import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; @@ -5,7 +5,7 @@ import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
5 import { DisplayDirection } from 'wdConstant/Index'; 5 import { DisplayDirection } from 'wdConstant/Index';
6 import mediaquery from '@ohos.mediaquery'; 6 import mediaquery from '@ohos.mediaquery';
7 import { CustomToast, Logger, WindowModel } from 'wdKit/Index'; 7 import { CustomToast, Logger, WindowModel } from 'wdKit/Index';
8 -import { router, window } from '@kit.ArkUI'; 8 +import { display, router, window } from '@kit.ArkUI';
9 import { WDAliPlayerController } from 'wdPlayer/Index'; 9 import { WDAliPlayerController } from 'wdPlayer/Index';
10 import { LiveOperRowListView } from 'wdComponent'; 10 import { LiveOperRowListView } from 'wdComponent';
11 import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; 11 import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
@@ -49,8 +49,9 @@ export struct DetailPlayLivePage { @@ -49,8 +49,9 @@ export struct DetailPlayLivePage {
49 @Provide banComment: boolean = true 49 @Provide banComment: boolean = true
50 @State isEnd: boolean = false 50 @State isEnd: boolean = false
51 @Consume liveDetailPageLogic: LiveDetailPageLogic 51 @Consume liveDetailPageLogic: LiveDetailPageLogic
52 -  
53 @State toastText: ResourceStr = "这是一个非Wi-Fi环境。请注意流量消耗" 52 @State toastText: ResourceStr = "这是一个非Wi-Fi环境。请注意流量消耗"
  53 + @State topPlayHeight:number = this.getTopPlayHeight()
  54 + @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
54 dialogToast: CustomDialogController = new CustomDialogController({ 55 dialogToast: CustomDialogController = new CustomDialogController({
55 builder: CustomToast({ 56 builder: CustomToast({
56 bgColor: 0xB3000000, 57 bgColor: 0xB3000000,
@@ -162,7 +163,7 @@ export struct DetailPlayLivePage { @@ -162,7 +163,7 @@ export struct DetailPlayLivePage {
162 build() { 163 build() {
163 Column() { 164 Column() {
164 TopPlayComponent({ playerController: this.playerController, isEnd: this.isEnd, lastLiveControl: this.lastLiveControl }) 165 TopPlayComponent({ playerController: this.playerController, isEnd: this.isEnd, lastLiveControl: this.lastLiveControl })
165 - .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') 166 + .height(this.displayDirection == DisplayDirection.VERTICAL ? this.topPlayHeight : '100%')
166 .margin({ 167 .margin({
167 top: this.displayDirection == DisplayDirection.VERTICAL ? px2vp(this.topSafeHeight) : 0 168 top: this.displayDirection == DisplayDirection.VERTICAL ? px2vp(this.topSafeHeight) : 0
168 }) 169 })
@@ -274,4 +275,14 @@ export struct DetailPlayLivePage { @@ -274,4 +275,14 @@ export struct DetailPlayLivePage {
274 275
275 }) 276 })
276 } 277 }
  278 +
  279 + getTopPlayHeight() {
  280 + let screenWidth = display.getDefaultDisplaySync().width
  281 + return px2vp(screenWidth) * 9/16.0
  282 + }
  283 +
  284 + currentChanged() {
  285 + this.topPlayHeight = this.getTopPlayHeight()
  286 + }
  287 +
277 } 288 }