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
liyubing
2024-06-04 17:13:22 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4a5df2a17fc4a43bc03255776168d93bef0bf516
4a5df2a1
1 parent
91fe3202
feat:
1、直播详情页面 状态栏处理
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
20 deletions
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerCommentComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
View file @
4a5df2a
...
...
@@ -4,7 +4,7 @@ import router from '@ohos.router';
import { DetailPlayLivePage } from './DetailPlayLivePage';
import { DetailPlayVLivePage } from './DetailPlayVLivePage';
import { DateTimeUtils, Logger, ToastUtils } from 'wdKit/Index';
import { DateTimeUtils, Logger, ToastUtils
, WindowModel
} from 'wdKit/Index';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { PictureLoading } from '../widgets/vertical/PictureLoading';
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
...
...
@@ -26,6 +26,8 @@ export struct DetailPlayLiveCommon {
private liveViewModel: LiveViewModel = new LiveViewModel()
pageShowTime: number = 0;
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide relId: string = ''
@Provide contentId: string = ''
@Provide relType: string = ''
...
...
@@ -83,7 +85,7 @@ export struct DetailPlayLiveCommon {
.height('100%')
.width('100%')
.backgroundColor(Color.Black)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
//
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
/**
...
...
@@ -153,6 +155,7 @@ export struct DetailPlayLiveCommon {
this.pageShow = Math.random()
Logger.info(TAG, 'onPageShow')
this.pageShowTime = DateTimeUtils.getTimeStamp()
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'})
}
onPageHide() {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
4a5df2a
...
...
@@ -39,6 +39,8 @@ export struct DetailPlayLivePage {
// 尽量不要动属性。用来作为输入了评论之后,值传递
@State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息
@State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息
// 顶部状态栏高度
@Consume topSafeHeight: number
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
...
...
@@ -50,7 +52,7 @@ export struct DetailPlayLivePage {
} else {
this.displayDirection = DisplayDirection.VERTICAL
}
WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
//
WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
})
this.getLiveDetails()
this.getLiveRoomData()
...
...
@@ -66,9 +68,11 @@ export struct DetailPlayLivePage {
build() {
Column() {
TopPlayComponent({ playerController: this.playerController })
.height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%')
.margin({
top: this.displayDirection == DisplayDirection.VERTICAL ? px2vp(this.topSafeHeight) : 0
})
TabComponent({
tabs: this.tabs,
...
...
@@ -114,7 +118,6 @@ export struct DetailPlayLivePage {
.height('100%')
.width('100%')
// 设置底部绘制延伸到导航条
}
onPageShowCus(): void {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
View file @
4a5df2a
...
...
@@ -23,8 +23,8 @@ export struct DetailPlayVLivePage {
private playerController: WDAliPlayerController = new WDAliPlayerController();
private swiperController: SwiperController = new SwiperController()
@Consume contentDetailData: ContentDetailDTO
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@Consume bottomSafeHeight: number
@Consume topSafeHeight: number
@Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean
@Provide isShowControl: boolean = false
@Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL //横竖屏,默认竖屏
...
...
@@ -53,14 +53,16 @@ export struct DetailPlayVLivePage {
openFullScreen() {
console.log(TAG, 'openFullScreen')
WindowModel.shared.setWindowLayoutFullScreen(true)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
// WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setSpecificSystemBarEnabled()
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
}
closeFullScreen() {
console.log(TAG, 'closeFullScreen')
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
// WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setSpecificSystemBarEnabled(true)
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
build() {
...
...
@@ -72,7 +74,6 @@ export struct DetailPlayVLivePage {
.width('100%')
.blur(100)
.renderFit(RenderFit.RESIZE_COVER)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
// 直播结束且无回看
if (this.liveState === 'end' && !this.playUrl) {
PlayerEndView()
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
View file @
4a5df2a
...
...
@@ -101,9 +101,8 @@ export struct PlayUIComponent {
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
// devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
// window.Orientation.PORTRAIT :
// window.Orientation.LANDSCAPE);
WindowModel.shared.setSpecificSystemBarEnabled(true)
})
if (this.contentDetailData.liveInfo?.liveState != 'wait') {
Text(this.contentDetailData.newsTitle)
...
...
@@ -310,12 +309,14 @@ export struct PlayUIComponent {
this.displayDirection =
this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL :
DisplayDirection.VERTICAL
WindowModel.shared.setSpecificSystemBarEnabled(false)
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
// devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
// window.Orientation.PORTRAIT :
// window.Orientation.LANDSCAPE);
})
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
View file @
4a5df2a
...
...
@@ -178,7 +178,6 @@ export struct TopPlayComponent {
if (this.liveDetailPageLogic.showPad) {
} else {
// 视频资源播放
WDPlayerRenderLiveView({
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/vertical/PlayerCommentComponent.ets
View file @
4a5df2a
...
...
@@ -128,7 +128,7 @@ export struct PlayerCommentComponent {
}
},
onBack: () => {
WindowModel.shared.setWindowLayoutFullScreen(false)
//
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
})
...
...
Please
register
or
login
to post a comment