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
wangyujian_wd
2024-04-16 21:17:11 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
27e091b04e57c12d837feb34df9f95b245321745
27e091b0
1 parent
b5834f6a
feat:1)直播详情信息横屏播放器和间接直播间UI逻辑修改
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
78 additions
and
23 deletions
sight_harmony/features/wdBean/src/main/ets/bean/live/LiveDetailsBean.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabChatComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabInfoComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveItemComponent.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/wdBean/src/main/ets/bean/live/LiveDetailsBean.ets
View file @
27e091b
...
...
@@ -171,10 +171,12 @@ export interface LiveInfo {
liveState: string
//2024-04-12 15:00:00 直播开始时间
planStartTime: string
mliveId:string
vlive: Array<Vlive>
mlive:MLive
}
export interface MLive {
mliveId:string
}
export interface FullColumnImgUrls {
url: string
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
27e091b
...
...
@@ -10,13 +10,14 @@ import router from '@ohos.router';
export struct DetailPlayLivePage {
TAG: string = 'DetailPlayLivePage';
liveViewModel: LiveViewModel = new LiveViewModel()
@State relId: string = ''
@State contentId: string = ''
@State relType: string = ''
@State relId: string = '500005302448'
@State contentId: string = '20000016340'
@State relType: string = '1'
@Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean
@Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean
aboutToAppear(): void {
//https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/content/zh/c/content/detail?relId=500005302448&relType=1&contentId=20000016340
let par: Action = router.getParams() as Action;
let params = par?.params;
this.relId = params?.extra?.relId || '';
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabChatComponent.ets
View file @
27e091b
import { LiveRoomItemBean } from 'wdBean/Index'
import { Live
DetailsBean, Live
RoomItemBean } from 'wdBean/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI } from 'wdComponent/Index'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout'
...
...
@@ -14,6 +14,7 @@ export struct TabChatComponent {
@State private pageModel: PageModel = new PageModel()
liveViewModel: LiveViewModel = new LiveViewModel()
@State liveChatList: Array<LiveRoomItemBean> = []
@Consume liveDetailsBean: LiveDetailsBean
aboutToAppear(): void {
this.getLiveChatList()
...
...
@@ -77,7 +78,11 @@ export struct TabChatComponent {
getLiveChatList() {
this.pageModel.currentPage = 1
this.liveViewModel.getLiveChatList(1, '20000016257', '20000016229', 20,)
this.liveViewModel.getLiveChatList(
1,
this.liveDetailsBean?.liveInfo?.mlive?.mliveId,
this.liveDetailsBean?.newsId,
20,)
.then(
(data) => {
if (data.barrageResponses && data.barrageResponses.length > 0) {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabInfoComponent.ets
View file @
27e091b
...
...
@@ -19,6 +19,7 @@ export struct TabInfoComponent {
right: 16
})
.height('100%')
.alignItems(HorizontalAlign.Start)
}
aboutToDisappear(): void {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveComponent.ets
View file @
27e091b
...
...
@@ -39,7 +39,11 @@ export struct TabLiveComponent {
}
getLiveList() {
this.liveViewModel.getLiveList(1, '20000016257', '20000016229', 20,)
this.liveViewModel.getLiveList(
1,
this.liveDetailsBean?.liveInfo?.mlive?.mliveId,
this.liveDetailsBean?.newsId,
20)
.then(
(data) => {
/**
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveItemComponent.ets
View file @
27e091b
...
...
@@ -75,6 +75,8 @@ export struct TabLiveItemComponent {
left: 32,
top: 6
})
.width('100%')
.textAlign(TextAlign.Start)
List() {
ForEach(this.item.pictureUrls, (item: string, index: number) => {
ListItem() {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
View file @
27e091b
import { window } from '@kit.ArkUI'
import {
DateTimeUtils,
NumberFormatterUtils, WindowModel } from 'wdKit/Index'
import { NumberFormatterUtils, WindowModel } from 'wdKit/Index'
import { devicePLSensorManager } from 'wdDetailPlayApi/Index'
import { DateFormatUtil, WDPlayerController } from 'wdPlayer/Index'
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { WDPlayerController } from 'wdPlayer/Index'
@Entry
@Component
...
...
@@ -23,8 +23,8 @@ export struct PlayUIComponent {
aboutToAppear(): void {
//播放进度监听
this.playerController.onTimeUpdate = (position: number, duration: number) => {
this.currentTime = DateTimeUtils.secondToTime(position);
this.totalTime = DateTimeUtils.secondToTime(duration);
this.currentTime = DateFormatUtil.secondToTime(Math.floor(position / 1000));
this.totalTime = DateFormatUtil.secondToTime(Math.floor(duration / 1000));
this.progressVal = Math.floor(position * 100 / duration);
}
}
...
...
@@ -67,13 +67,13 @@ export struct PlayUIComponent {
.width('100%')
.alignItems(VerticalAlign.Center)
.margin({
bottom:
5
bottom:
10
})
this.getLiveStatusView()
}.width('100%')
.padding({
top:
1
0,
top:
2
0,
bottom: 6,
left: 10,
right: 10
...
...
@@ -84,9 +84,35 @@ export struct PlayUIComponent {
@Builder
getLiveStatusView() {
//预约
//直播中
// 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
// 预约
// 直播中
if (this.liveDetailsBean.liveInfo?.liveState == 'running') {
Row() {
Image($r('app.media.icon_live_status_running'))
.width(22)
.height(18)
Text('直播中')
.fontSize('11fp')
.fontWeight(400)
.fontColor(Color.White)
Image($r('app.media.icon_live_player_status_end'))
.width(12)
.height(12)
Text(`${NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean.pv)}人参与`)
.fontSize('11fp')
.fontWeight(400)
.fontColor(Color.White)
}
.backgroundColor('#4D000000')
.padding({
top: 1,
right: 4,
bottom: 1
})
}
//回看
else if (this.liveDetailsBean.liveInfo?.liveState == 'end') {
Row() {
Text('回看')
.fontSize('11fp')
...
...
@@ -108,6 +134,7 @@ export struct PlayUIComponent {
bottom: 1
})
}
}
@Builder
getMiddleUIComponent() {
...
...
@@ -122,6 +149,7 @@ export struct PlayUIComponent {
@Builder
getBottomUIComponent() {
Row() {
if (this.liveDetailsBean?.liveInfo?.liveState == 'end') {
this.playOrPauseBtn()
Text(this.currentTime)
.fontColor(Color.White)
...
...
@@ -140,6 +168,9 @@ export struct PlayUIComponent {
.margin({
right: 16
})
} else {
Blank()
}
Image($r('app.media.icon_live_player_full_screen'))
.width(24)
.height(24)
...
...
@@ -183,16 +214,19 @@ export struct PlayUIComponent {
Slider({
value: this.progressVal,
step: 1,
// style: SliderStyle.OutSet
})
.blockStyle({
type: SliderBlockType.IMAGE,
image: $r('app.media.ic_player_block')
style: SliderStyle.OutSet
})
.blockSize({
width: 18,
height: 12
})// .blockStyle({
// type: SliderBlockType.IMAGE,
// image: $r('app.media.ic_player_block')
// })
.blockColor(Color.White)
.trackColor('#4DFFFFFF')
.selectedColor('#FFED2800')
.height(
2
)
.height(
14
)
.trackThickness(1)
.layoutWeight(1)
.margin({
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
View file @
27e091b
...
...
@@ -14,8 +14,14 @@ export struct TopPlayComponent {
}
updateData() {
//直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) {
let playUrl: string = this.liveDetailsBean.liveInfo.vlive[0].replayUri
let playUrl = ''
if (this.liveDetailsBean.liveInfo.liveState == 'running') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl
} else if (this.liveDetailsBean.liveInfo.liveState == 'end') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
}
this.playerController.firstPlay(playUrl);
}
}
...
...
Please
register
or
login
to post a comment