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
zhenghy
2024-04-24 15:08:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d59d4674af6f2233dccdf4e4ae7eb962a14e5f47
d59d4674
1 parent
f72ebf20
修复直播频道切换问题
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
61 deletions
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
View file @
d59d467
...
...
@@ -121,35 +121,6 @@ export struct LiveHorizontalCardComponent {
}
async gotoLive(content: ContentDTO) {
const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '')
if (content && content.objectType) {
if (content.objectType === ContentConstants.TYPE_LIVE) {
if (liveDetail && liveDetail[0] && liveDetail[0].liveInfo) {
const liveStyle = liveDetail[0].liveInfo.liveStyle
const liveState = liveDetail[0].liveInfo.liveState
console.error('liveDetail===', liveDetail)
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 2,
contentID: content?.objectId,
liveStyle: liveState === 'wait' ? 0 : liveStyle,
extra: {
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
// Logger.debug(TAG, `gotoLive, ${content.objectId}`);
}
} else if (content.objectType === ContentConstants.TYPE_TELETEXT) {
ProcessUtils.processPage(content)
}
}
ProcessUtils.processPage(content)
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
View file @
d59d467
...
...
@@ -32,19 +32,32 @@ export struct DetailPlayShortVideoPage {
@Provide followStatus: string = '0' // 关注状态
@Provide isOpenDetail: boolean = false // 查看详情按钮点击
@Provide isDragging: boolean = false // 拖动时间进度条
@Consume @Watch('videoStatusChange') switchVideoStatus: boolean
@Consume @Watch('pageShowChange') pageShow: number
@Consume @Watch('pageHideChange') pageHide: number
/**
* 页面显示重查用户关注、点赞等信息
*/
pageShowChange() {
if (this.currentIndex === this.index && this.playerController.getStatus() === PlayerConstants.STATUS_PAUSE) {
this.playerController.play()
if (this.currentIndex === this.index) {
this.queryNewsInfoOfUser()
if (this.switchVideoStatus) {
this.playerController.play()
}
}
}
pageHideChange() {
if (this.currentIndex === this.index && this.playerController.getStatus() === PlayerConstants.STATUS_START) {
this.playerController.pause()
/**
* 频道切换视频暂停、播放
* 页面显隐视频暂停、播放
*/
videoStatusChange() {
if (this.currentIndex === this.index) {
if (this.switchVideoStatus) {
this.playerController.play()
} else {
this.playerController.pause()
}
}
}
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
View file @
d59d467
...
...
@@ -22,12 +22,12 @@ export struct DetailVideoListPage {
@Provide showComment: boolean = true
@Provide pageShow: number = -1
@Provide pageHide: number = -1
@Provide switchVideoStatus: boolean = false
@State data: ContentDetailDTO[] = []
@State testData: string[] = ['111', '222', '333']
@State currentIndex: number = 0
@State interactDataList: InteractDataDTO[] = []
@State isFullScreen: boolean = false
@State switchVideoStatus: boolean = false
async aboutToAppear(): Promise<void> {
this.openFullScreen()
...
...
@@ -57,13 +57,14 @@ export struct DetailVideoListPage {
onPageShow(): void {
console.log(TAG, 'onPageShow')
this.pageShow = Math.random()
this.switchVideoStatus = true
this.openFullScreen()
}
onPageHide(): void {
console.log(TAG, 'onPageHide')
this.
pageHide = Math.random()
this.
switchVideoStatus = false
this.closeFullScreen()
}
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
View file @
d59d467
...
...
@@ -46,37 +46,43 @@ export struct VideoChannelDetail {
private swiperController: SwiperController = new SwiperController()
@Provide showComment: boolean = false
@Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0
@Consume pageShow: number
@Consume pageHide: number
@Consume @Watch('pageShowChange') pageShow: number
@Consume @Watch('pageHideChange') pageHide: number
@Provide switchVideoStatus: boolean = false
@State data: ContentDetailDTO[] = []
@State currentIndex: number = 0
@State interactDataList: InteractDataDTO[] = []
@State totalCount: number = 0
@State isMouted: boolean = false
pageShowChange() {
if (this.bottomNavIndex === 2 && this.topNavIndex === 0) {
this.barBackgroundColor = Color.Black
this.switchVideoStatus = true
this.openFullScreen()
}
}
pageHideChange() {
this.barBackgroundColor = Color.Transparent
this.switchVideoStatus = false
this.closeFullScreen()
}
/**
* 监听视频频道激活或失活
*/
navIndexChange() {
// if (timer) clearTimeout(timer)
console.log('navIndexChange', this.bottomNavIndex, this.topNavIndex)
// timer = setTimeout(() => {
if (this.bottomNavIndex === 2 && this.topNavIndex === 0) {
// 如果视频在暂停则播放视频
this.barBackgroundColor = Color.Black
this.
pageShow = Math.random()
this.
switchVideoStatus = true
this.openFullScreen()
} else {
// 如果视频在播放则暂停视频
this.barBackgroundColor = Color.Transparent
this.
pageHide = Math.random()
this.
switchVideoStatus = false
this.closeFullScreen()
}
// timer = -1
// }, 100)
}
aboutToAppear() {
...
...
@@ -91,16 +97,6 @@ export struct VideoChannelDetail {
Logger.info(TAG, 'aboutToDisappear');
}
onPageShow(): void {
this.openFullScreen()
Logger.info(TAG, 'onPageShow');
}
onPageHide(): void {
this.closeFullScreen()
Logger.info(TAG, 'onPageHide');
}
/**
* 开启沉浸式
* TODO:颜色待根据业务接口修改
...
...
Please
register
or
login
to post a comment