王士厅
... ... @@ -5,7 +5,7 @@ import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
import { DisplayDirection } from 'wdConstant/Index';
import mediaquery from '@ohos.mediaquery';
import { CustomToast, Logger, WindowModel } from 'wdKit/Index';
import { router, window } from '@kit.ArkUI';
import { display, router, window } from '@kit.ArkUI';
import { WDAliPlayerController } from 'wdPlayer/Index';
import { LiveOperRowListView } from 'wdComponent';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
... ... @@ -49,8 +49,9 @@ export struct DetailPlayLivePage {
@Provide banComment: boolean = true
@State isEnd: boolean = false
@Consume liveDetailPageLogic: LiveDetailPageLogic
@State toastText: ResourceStr = "这是一个非Wi-Fi环境。请注意流量消耗"
@State topPlayHeight:number = this.getTopPlayHeight()
@StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
bgColor: 0xB3000000,
... ... @@ -162,7 +163,7 @@ export struct DetailPlayLivePage {
build() {
Column() {
TopPlayComponent({ playerController: this.playerController, isEnd: this.isEnd, lastLiveControl: this.lastLiveControl })
.height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%')
.height(this.displayDirection == DisplayDirection.VERTICAL ? this.topPlayHeight : '100%')
.margin({
top: this.displayDirection == DisplayDirection.VERTICAL ? px2vp(this.topSafeHeight) : 0
})
... ... @@ -274,4 +275,14 @@ export struct DetailPlayLivePage {
})
}
getTopPlayHeight() {
let screenWidth = display.getDefaultDisplaySync().width
return px2vp(screenWidth) * 9/16.0
}
currentChanged() {
this.topPlayHeight = this.getTopPlayHeight()
}
}
\ No newline at end of file
... ...