Showing
6 changed files
with
27 additions
and
20 deletions
| @@ -4,7 +4,7 @@ import router from '@ohos.router'; | @@ -4,7 +4,7 @@ import router from '@ohos.router'; | ||
| 4 | 4 | ||
| 5 | import { DetailPlayLivePage } from './DetailPlayLivePage'; | 5 | import { DetailPlayLivePage } from './DetailPlayLivePage'; |
| 6 | import { DetailPlayVLivePage } from './DetailPlayVLivePage'; | 6 | import { DetailPlayVLivePage } from './DetailPlayVLivePage'; |
| 7 | -import { DateTimeUtils, Logger, ToastUtils } from 'wdKit/Index'; | 7 | +import { DateTimeUtils, Logger, ToastUtils, WindowModel } from 'wdKit/Index'; |
| 8 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; | 8 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; |
| 9 | import { PictureLoading } from '../widgets/vertical/PictureLoading'; | 9 | import { PictureLoading } from '../widgets/vertical/PictureLoading'; |
| 10 | import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; | 10 | import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; |
| @@ -26,6 +26,8 @@ export struct DetailPlayLiveCommon { | @@ -26,6 +26,8 @@ export struct DetailPlayLiveCommon { | ||
| 26 | private liveViewModel: LiveViewModel = new LiveViewModel() | 26 | private liveViewModel: LiveViewModel = new LiveViewModel() |
| 27 | pageShowTime: number = 0; | 27 | pageShowTime: number = 0; |
| 28 | 28 | ||
| 29 | + @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 30 | + @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 29 | @Provide relId: string = '' | 31 | @Provide relId: string = '' |
| 30 | @Provide contentId: string = '' | 32 | @Provide contentId: string = '' |
| 31 | @Provide relType: string = '' | 33 | @Provide relType: string = '' |
| @@ -83,7 +85,7 @@ export struct DetailPlayLiveCommon { | @@ -83,7 +85,7 @@ export struct DetailPlayLiveCommon { | ||
| 83 | .height('100%') | 85 | .height('100%') |
| 84 | .width('100%') | 86 | .width('100%') |
| 85 | .backgroundColor(Color.Black) | 87 | .backgroundColor(Color.Black) |
| 86 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | 88 | + // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) |
| 87 | } | 89 | } |
| 88 | 90 | ||
| 89 | /** | 91 | /** |
| @@ -153,6 +155,7 @@ export struct DetailPlayLiveCommon { | @@ -153,6 +155,7 @@ export struct DetailPlayLiveCommon { | ||
| 153 | this.pageShow = Math.random() | 155 | this.pageShow = Math.random() |
| 154 | Logger.info(TAG, 'onPageShow') | 156 | Logger.info(TAG, 'onPageShow') |
| 155 | this.pageShowTime = DateTimeUtils.getTimeStamp() | 157 | this.pageShowTime = DateTimeUtils.getTimeStamp() |
| 158 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'}) | ||
| 156 | } | 159 | } |
| 157 | 160 | ||
| 158 | onPageHide() { | 161 | onPageHide() { |
| @@ -39,6 +39,8 @@ export struct DetailPlayLivePage { | @@ -39,6 +39,8 @@ export struct DetailPlayLivePage { | ||
| 39 | // 尽量不要动属性。用来作为输入了评论之后,值传递 | 39 | // 尽量不要动属性。用来作为输入了评论之后,值传递 |
| 40 | @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息 | 40 | @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息 |
| 41 | @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息 | 41 | @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息 |
| 42 | + // 顶部状态栏高度 | ||
| 43 | + @Consume topSafeHeight: number | ||
| 42 | 44 | ||
| 43 | aboutToAppear(): void { | 45 | aboutToAppear(): void { |
| 44 | Logger.info(TAG, `wyj-aboutToAppear`) | 46 | Logger.info(TAG, `wyj-aboutToAppear`) |
| @@ -50,7 +52,7 @@ export struct DetailPlayLivePage { | @@ -50,7 +52,7 @@ export struct DetailPlayLivePage { | ||
| 50 | } else { | 52 | } else { |
| 51 | this.displayDirection = DisplayDirection.VERTICAL | 53 | this.displayDirection = DisplayDirection.VERTICAL |
| 52 | } | 54 | } |
| 53 | - WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) | 55 | + // WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) |
| 54 | }) | 56 | }) |
| 55 | this.getLiveDetails() | 57 | this.getLiveDetails() |
| 56 | this.getLiveRoomData() | 58 | this.getLiveRoomData() |
| @@ -66,9 +68,11 @@ export struct DetailPlayLivePage { | @@ -66,9 +68,11 @@ export struct DetailPlayLivePage { | ||
| 66 | 68 | ||
| 67 | build() { | 69 | build() { |
| 68 | Column() { | 70 | Column() { |
| 69 | - | ||
| 70 | TopPlayComponent({ playerController: this.playerController }) | 71 | TopPlayComponent({ playerController: this.playerController }) |
| 71 | .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') | 72 | .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') |
| 73 | + .margin({ | ||
| 74 | + top: this.displayDirection == DisplayDirection.VERTICAL ? px2vp(this.topSafeHeight) : 0 | ||
| 75 | + }) | ||
| 72 | 76 | ||
| 73 | TabComponent({ | 77 | TabComponent({ |
| 74 | tabs: this.tabs, | 78 | tabs: this.tabs, |
| @@ -114,7 +118,6 @@ export struct DetailPlayLivePage { | @@ -114,7 +118,6 @@ export struct DetailPlayLivePage { | ||
| 114 | .height('100%') | 118 | .height('100%') |
| 115 | .width('100%') | 119 | .width('100%') |
| 116 | 120 | ||
| 117 | - // 设置底部绘制延伸到导航条 | ||
| 118 | } | 121 | } |
| 119 | 122 | ||
| 120 | onPageShowCus(): void { | 123 | onPageShowCus(): void { |
| @@ -23,8 +23,8 @@ export struct DetailPlayVLivePage { | @@ -23,8 +23,8 @@ export struct DetailPlayVLivePage { | ||
| 23 | private playerController: WDAliPlayerController = new WDAliPlayerController(); | 23 | private playerController: WDAliPlayerController = new WDAliPlayerController(); |
| 24 | private swiperController: SwiperController = new SwiperController() | 24 | private swiperController: SwiperController = new SwiperController() |
| 25 | @Consume contentDetailData: ContentDetailDTO | 25 | @Consume contentDetailData: ContentDetailDTO |
| 26 | - @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 27 | - @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 26 | + @Consume bottomSafeHeight: number |
| 27 | + @Consume topSafeHeight: number | ||
| 28 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean | 28 | @Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean |
| 29 | @Provide isShowControl: boolean = false | 29 | @Provide isShowControl: boolean = false |
| 30 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL //横竖屏,默认竖屏 | 30 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL //横竖屏,默认竖屏 |
| @@ -53,14 +53,16 @@ export struct DetailPlayVLivePage { | @@ -53,14 +53,16 @@ export struct DetailPlayVLivePage { | ||
| 53 | 53 | ||
| 54 | openFullScreen() { | 54 | openFullScreen() { |
| 55 | console.log(TAG, 'openFullScreen') | 55 | console.log(TAG, 'openFullScreen') |
| 56 | - WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 57 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | 56 | + // WindowModel.shared.setWindowLayoutFullScreen(true) |
| 57 | + // WindowModel.shared.setSpecificSystemBarEnabled() | ||
| 58 | + // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | ||
| 58 | } | 59 | } |
| 59 | 60 | ||
| 60 | closeFullScreen() { | 61 | closeFullScreen() { |
| 61 | console.log(TAG, 'closeFullScreen') | 62 | console.log(TAG, 'closeFullScreen') |
| 62 | - WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 63 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | 63 | + // WindowModel.shared.setWindowLayoutFullScreen(false) |
| 64 | + // WindowModel.shared.setSpecificSystemBarEnabled(true) | ||
| 65 | + // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 64 | } | 66 | } |
| 65 | 67 | ||
| 66 | build() { | 68 | build() { |
| @@ -72,7 +74,6 @@ export struct DetailPlayVLivePage { | @@ -72,7 +74,6 @@ export struct DetailPlayVLivePage { | ||
| 72 | .width('100%') | 74 | .width('100%') |
| 73 | .blur(100) | 75 | .blur(100) |
| 74 | .renderFit(RenderFit.RESIZE_COVER) | 76 | .renderFit(RenderFit.RESIZE_COVER) |
| 75 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 76 | // 直播结束且无回看 | 77 | // 直播结束且无回看 |
| 77 | if (this.liveState === 'end' && !this.playUrl) { | 78 | if (this.liveState === 'end' && !this.playUrl) { |
| 78 | PlayerEndView() | 79 | PlayerEndView() |
| @@ -101,9 +101,8 @@ export struct PlayUIComponent { | @@ -101,9 +101,8 @@ export struct PlayUIComponent { | ||
| 101 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | 101 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? |
| 102 | window.Orientation.PORTRAIT : | 102 | window.Orientation.PORTRAIT : |
| 103 | window.Orientation.LANDSCAPE_INVERTED) | 103 | window.Orientation.LANDSCAPE_INVERTED) |
| 104 | - // devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 105 | - // window.Orientation.PORTRAIT : | ||
| 106 | - // window.Orientation.LANDSCAPE); | 104 | + WindowModel.shared.setSpecificSystemBarEnabled(true) |
| 105 | + | ||
| 107 | }) | 106 | }) |
| 108 | if (this.contentDetailData.liveInfo?.liveState != 'wait') { | 107 | if (this.contentDetailData.liveInfo?.liveState != 'wait') { |
| 109 | Text(this.contentDetailData.newsTitle) | 108 | Text(this.contentDetailData.newsTitle) |
| @@ -310,12 +309,14 @@ export struct PlayUIComponent { | @@ -310,12 +309,14 @@ export struct PlayUIComponent { | ||
| 310 | this.displayDirection = | 309 | this.displayDirection = |
| 311 | this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : | 310 | this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : |
| 312 | DisplayDirection.VERTICAL | 311 | DisplayDirection.VERTICAL |
| 312 | + | ||
| 313 | + WindowModel.shared.setSpecificSystemBarEnabled(false) | ||
| 314 | + | ||
| 313 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | 315 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? |
| 314 | window.Orientation.PORTRAIT : | 316 | window.Orientation.PORTRAIT : |
| 315 | window.Orientation.LANDSCAPE_INVERTED) | 317 | window.Orientation.LANDSCAPE_INVERTED) |
| 316 | - // devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 317 | - // window.Orientation.PORTRAIT : | ||
| 318 | - // window.Orientation.LANDSCAPE); | 318 | + |
| 319 | + | ||
| 319 | }) | 320 | }) |
| 320 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 321 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 321 | } | 322 | } |
| @@ -178,7 +178,6 @@ export struct TopPlayComponent { | @@ -178,7 +178,6 @@ export struct TopPlayComponent { | ||
| 178 | 178 | ||
| 179 | if (this.liveDetailPageLogic.showPad) { | 179 | if (this.liveDetailPageLogic.showPad) { |
| 180 | 180 | ||
| 181 | - | ||
| 182 | } else { | 181 | } else { |
| 183 | // 视频资源播放 | 182 | // 视频资源播放 |
| 184 | WDPlayerRenderLiveView({ | 183 | WDPlayerRenderLiveView({ |
| @@ -128,7 +128,7 @@ export struct PlayerCommentComponent { | @@ -128,7 +128,7 @@ export struct PlayerCommentComponent { | ||
| 128 | } | 128 | } |
| 129 | }, | 129 | }, |
| 130 | onBack: () => { | 130 | onBack: () => { |
| 131 | - WindowModel.shared.setWindowLayoutFullScreen(false) | 131 | + // WindowModel.shared.setWindowLayoutFullScreen(false) |
| 132 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | 132 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 133 | } | 133 | } |
| 134 | }) | 134 | }) |
-
Please register or login to post a comment