liyubing

fix:直播详情页面,两次调用相同接口,处理成只调用一次

Showing 20 changed files with 178 additions and 363 deletions
... ... @@ -6,6 +6,7 @@ import { VideoInfoDTO } from './VideoInfoDTO';
import { RmhInfoDTO } from './RmhInfoDTO'
import { UserInfoDTO } from './UserInfoDTO'
/**
* 接口定义:
* http://192.168.1.3:3300/project/3802/interface/api/200915
... ... @@ -40,7 +41,7 @@ export interface ContentDetailDTO {
shareInfo: ShareInfoDTO;
photoList: any[];
videoInfo: VideoInfoDTO[];
liveInfo?: any;
liveInfo?: any ;
voteInfo?: any;
rmhInfo?: RmhInfoDTO | null;
userInfo?: UserInfoDTO | null;
... ...
import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO'
import { ReLInfoDTO } from '../detail/ReLInfoDTO'
import { RmhInfoDTO } from '../detail/RmhInfoDTO'
export interface LiveDetailsBean {
/**
* {
"code": "0",
"data": [
{
"activityInfos": [],
"appstyle": 2,
"audioList": [],
"authorList": [
{
"authorName": "雷崔捷"
}
],
"bestNoticer": null,
"commentDisplay": 0,
"editorName": "",
"firstFrameImageUri": "",
"fullColumnImgUrls": [
{
"format": null,
"height": null,
"landscape": null,
"size": null,
"url": "https://rmrbcmsonline.peopleapp.com/upload/image/202404/rmrb_71671711971849.png",
"weight": null
}
],
"hasPopUp": null,
"isNewspaper": false,
"itemId": "",
"itemTypeCode": "",
"keyArticle": 0,
"likesStyle": null,
"liveInfo": {
"background": {
"imageUrl": "",
"name": ""
},
"backgroundStyle": null,
"cornerFlag": 0,
"cornerImgUrl": "",
"cornerLinkUrl": "",
"createUserId": "",
"createUserName": "",
"endTime": "2024-04-03 11:08:00",
"handAngleImageUri": "",
"handAngleLink": "",
"handAngleSwitch": false,
"likeEnable": 1,
"likesStyle": "thumb",
"liveExperience": 1,
"liveExperienceTime": 3,
"liveLandScape": "news",
"liveState": "end",
"liveStyle": 0,
"liveWay": 0,
"mlive": {
"barrageShowEnable": false,
"giftEnable": false,
"mliveId": 20000016257,
"roomId": "5381b934-cea8-4338-bd12-5bf70af43e0c"
},
"notice": "",
"openComment": 1,
"padImageUri": "",
"planStartTime": "2024-04-03 05:00:00",
"playbackSwitch": true,
"preCommentFlag": 1,
"previewType": 1,
"previewUrl": "",
"shareSwitch": "",
"startTime": "2024-04-03 05:03:23",
"tplId": 5,
"vlive": [
{
"coverImageUrl": "",
"definition": [],
"liveStreamManagerId": null,
"liveStreamType": 1,
"liveUrl": "https://plwbthird.live.weibo.com/alicdn/5018938748437049.m3u8",
"name": "线路1",
"replayUri": "http://mlive3.video.weibocdn.com/record/alicdn/5018726527666338/index.m3u8",
"serialNum": null,
"shiftEnable": false,
"showPad": false,
"type": "play",
"vliveId": 186728
}
],
"vrType": 0
},
"menuShow": 1,
"newIntroduction": "眼前有山河,心中有家国!每年清明节前夕,宁夏固原市第二中学和固原市弘文中学会组织入学新生,一天之内徒步54公里从学校往返任山河烈士陵园,用这种方式缅怀烈士们,这份坚定与执着已经延续了29年。",
"newLinkObject": null,
"newsBodyTitle": "",
"newsContent": "",
"newsContentBak": "",
"newsDownTitle": "",
"newsId": 20000016229,
"newsLinkUrl": "",
"newsShortTitle": "",
"newsSource": "41",
"newsSourceName": "",
"newsSummary": "",
"newsTags": "",
"newsTitle": "徒步54公里的思政课,坚守29年的薪火传承",
"newsType": 2,
"oldNewsId": "7218507",
"openAudio": 0,
"openComment": null,
"openLikes": null,
"photoList": [],
"popUps": [],
"preCommentFlag": null,
"publishTime": "2024-04-01 19:44:00",
"reLInfo": {
"channelId": 2061,
"relId": "500005272745",
"relObjectId": 2061,
"relType": "1"
},
"readFlag": 0,
"recommendShow": null,
"rmhInfo": null,
"rmhPlatform": 0,
"sceneId": "",
"serials": null,
"shareInfo": {
"shareCoverUrl": "https://rmrbcmsonline.peopleapp.com/upload/image/202404/202404011944259539.png?x-oss-process=image/resize,w_400",
"shareOpen": 1,
"sharePosterCoverUrl": "https://rmrbcmsonline.peopleapp.com/upload/image/202404/rmrb_71671711971849.png?x-oss-process=image/resize,m_fill,h_450,w_800,limit_0/quality,q_90",
"sharePosterOpen": 1,
"shareSummary": "人民日报,有品质的新闻",
"shareTitle": "徒步54公里的思政课,坚守29年的薪火传承",
"shareUrl": "https://people.pdnews.cn/column/20000016229-500005272745"
},
"specialColumnId": null,
"specialColumnName": "",
"subSceneId": "",
"timeline": null,
"topicInfo": null,
"traceId": "",
"traceInfo": "",
"userInfo": null,
"videoInfo": [],
"viewCount": 0,
"visitorComment": 1,
"voteInfo": null
}
],
"message": "Success",
"meta": null,
"requestId": "",
"success": true,
"timestamp": 1712807514322
}
*/
visitorComment: number
newsType: number;
keyArticle: number
liveInfo: LiveInfo
fullColumnImgUrls: Array<FullColumnImgUrlBean>
fullColumnImgUrls: Array<FullColumnImgUrlDTO>
newsTitle: string
newsId: string
newIntroduction: string
//迁移id
oldNewsId: string
reLInfo: ReLInfo
reLInfo: ReLInfoDTO
rmhInfo: RmhInfoDTO
}
... ... @@ -188,13 +38,6 @@ export interface MLive {
mliveId: string
}
export interface FullColumnImgUrlBean {
url: string
height: string
landscape: number
size: string
weight: string
}
export interface Vlive {
//拉流直播 url
... ... @@ -205,9 +48,7 @@ export interface Vlive {
liveStreamType: number | null
}
export interface ReLInfo {
relId: string
}
export interface joinPeopleNum {
barrageNum: number,
... ...
import { FullColumnImgUrlBean } from './LiveDetailsBean'
import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO'
export interface LiveRoomBean {
pageNum: number
pageSize: number
... ... @@ -32,6 +31,6 @@ export interface LiveRoomItemBean {
//音频地址
audioUrl: string
//详情页面插入数据bean
fullColumnImgUrlDto: FullColumnImgUrlBean
fullColumnImgUrlDto: FullColumnImgUrlDTO
}
\ No newline at end of file
... ...
... ... @@ -49,7 +49,7 @@ export struct LikeComponent {
// 2:竖屏直播页 3:图集 4:横屏直播页
if(this.pageComponentType == 2 || this.pageComponentType == 4) {
// 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福
this.likesStyle = this.contentDetailData?.liveInfo?.likesStyle
this.likesStyle = String(this.contentDetailData?.liveInfo?.likesStyle)
this.openLikes = this.contentDetailData?.liveInfo?.likeEnable == 1 ? true : false
} else {
// 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
... ...
import { ToastUtils, Logger, NumberFormatterUtils, SPHelper } from 'wdKit';
import { NumberFormatterUtils, SPHelper } from 'wdKit';
import promptAction from '@ohos.promptAction';
import {
InputMethodProperty,
batchLikeAndCollectResult,
batchLikeAndCollectParams,
batchLikeAndCollectResult,
ContentDetailDTO,
postExecuteLikeParams,
contentListParams,
InteractDataDTO,
postExecuteCollectRecordParams
... ... @@ -13,16 +11,15 @@ import {
import router from '@ohos.router';
import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
import { LikeComponent } from './LikeComponent';
import { CommentTabComponent, CommentIconComponent, } from '../comment/view/CommentTabComponent';
import { publishCommentModel } from '../comment/model/PublishCommentModel'
import { HttpUrlUtils } from 'wdNetwork/Index';
import { CommentIconComponent, CommentTabComponent, } from '../comment/view/CommentTabComponent';
import { publishCommentModel } from '../comment/model/PublishCommentModel';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { PageRepository } from '../../repository/PageRepository';
import { SpConstants } from 'wdConstant/Index';
import { WDShare } from 'wdShare/Index';
import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel'
import { EmitterEventId, EmitterUtils } from 'wdKit/Index'
import { PlayerConstants } from 'wdPlayer'
import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel';
import { EmitterEventId, EmitterUtils } from 'wdKit/Index';
import { PlayerConstants } from 'wdPlayer';
import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
const TAG = 'OperRowListView';
... ...
import { Action, ContentDetailDTO, LiveDetailsBean } from 'wdBean/Index';
import { Action, ContentDetailDTO } from 'wdBean/Index';
import { LiveViewModel } from '../viewModel/LiveViewModel';
import router from '@ohos.router';
... ... @@ -31,9 +31,10 @@ export struct DetailPlayLiveCommon {
@Provide pageShow: number = -1
@Provide pageHide: number = -1
@Provide pageBackPress: number = -1
@Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@Provide publishCommentModel: publishCommentModel = new publishCommentModel()
// 横屏或竖屏 general-竖屏,news-横屏
@State liveLandscape: string = ''
async aboutToAppear(): Promise<void> {
const par: Action = router.getParams() as Action;
... ... @@ -48,11 +49,11 @@ export struct DetailPlayLiveCommon {
build() {
Column() {
// 直播预约或横屏直播统一进横屏直播
if (this.liveState === 'wait' || this.liveStyle === 0) {
// 非沉浸式
if (this.liveState === 'wait' || this.liveLandscape === 'news') {
// 非沉浸式直播
DetailPlayLivePage({ contentId: this.contentId, relId: this.relId, relType: this.relType })
} else if (this.liveStyle === 1) {
// 沉浸式
} else if (this.liveLandscape === 'general') {
// 沉浸式直播
DetailPlayVLivePage()
}
}
... ... @@ -70,60 +71,43 @@ export struct DetailPlayLiveCommon {
.then((data: Array<ContentDetailDTO>) => {
console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data))
if (data) {
//todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行
setTimeout(() => {
this.contentDetailData = data[0];
// if (this.contentDetailData.openComment === 1) {
console.log(TAG, '查询视频详情用于评论展示 openComment:', this.contentDetailData.openComment)
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
}, 50)
let detailData = data[0]
console.log(TAG, '查询视频详情用于评论展示 openComment:', detailData.openComment)
this.publishCommentModel.targetId = String(detailData?.newsId || '')
this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '')
this.publishCommentModel.targetTitle = detailData?.newsTitle
this.publishCommentModel.targetRelType = String(detailData?.reLInfo?.relType || '')
this.publishCommentModel.targetRelObjectId = String(detailData?.reLInfo?.relObjectId || '')
this.publishCommentModel.keyArticle = String(detailData?.keyArticle || '')
this.publishCommentModel.targetType = String(detailData?.newsType || '')
this.publishCommentModel.visitorComment = String(detailData?.visitorComment || '')
this.publishCommentModel.commentContent = ''
this.getLiveDetails()
// }
}
})
}
this.liveLandscape =
detailData?.liveInfo?.liveLandScape //String(this.contentDetailData?.liveInfo?.liveLandScape || '')
/**
* 获取直播信息,可区分横竖屏直播
*/
getLiveDetails() {
this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType)
.then(
(data) => {
if (data.length > 0) {
this.liveState = detailData.liveInfo?.liveState
this.liveStyle = detailData.liveInfo?.liveStyle
//todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行
setTimeout(() => {
this.liveDetailsBean = data[0]
}, 10)
this.liveState = data[0].liveInfo?.liveState
this.liveStyle = data[0].liveInfo.liveStyle
if (data[0].fullColumnImgUrls && data[0].fullColumnImgUrls.length > 0) {
this.imgUrl = data[0].fullColumnImgUrls[0].url
if (detailData.fullColumnImgUrls && detailData.fullColumnImgUrls.length > 0) {
this.imgUrl = detailData.fullColumnImgUrls[0].url
}
if (data[0].liveInfo.liveState == 'end') {
this.playUrl = data[0].liveInfo.vlive[0].replayUri
if (detailData.liveInfo.liveState == 'end') {
this.playUrl = detailData.liveInfo.vlive[0].replayUri
}
// console.log(TAG, 'getLiveDetails:', JSON.stringify((this.liveDetailsBean)))
//console.error('XXXXZZZZ', "liveLandscape =" + this.liveLandscape + ' this.liveState =' + this.liveState)
}
},
() => {
})
}
onPageShow() {
this.pageShow = Math.random()
Logger.info(TAG, 'onPageShow')
... ...
import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index';
import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index';
import { LiveViewModel } from '../viewModel/LiveViewModel';
import { TabComponent } from '../widgets/details/TabComponent';
import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
... ... @@ -6,12 +6,9 @@ import { DisplayDirection } from 'wdConstant/Index';
import mediaquery from '@ohos.mediaquery';
import { Logger, WindowModel } from 'wdKit/Index';
import { router, window } from '@kit.ArkUI';
import { devicePLSensorManager } from 'wdDetailPlayApi/Index';
import { LiveCommentComponent } from 'wdComponent/Index';
import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index';
import { WDAliPlayerController } from 'wdPlayer/Index';
import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { ResponseDTO } from 'wdNetwork/Index';
let TAG: string = 'DetailPlayLivePage';
... ... @@ -37,7 +34,6 @@ export struct DetailPlayLivePage {
@Consume @Watch('onBackPressCus') pageBackPress: number
@Consume contentDetailData: ContentDetailDTO
@Consume publishCommentModel: publishCommentModel
@Consume liveDetailsBean: LiveDetailsBean
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
... ... @@ -65,11 +61,14 @@ export struct DetailPlayLivePage {
build() {
Column() {
TopPlayComponent({ playerController: this.playerController })
.height(this.displayDirection == DisplayDirection.VERTICAL ?211:'100%')
TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab })
.layoutWeight(1)
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
OperRowListView({
componentType: 4,
operationButtonList: ['comment', 'collect', 'share', 'like'],
... ... @@ -81,8 +80,7 @@ export struct DetailPlayLivePage {
// 切换到大家聊
this.changeToTab = Math.random()
}
})
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
}) .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
// LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
// .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
... ... @@ -120,7 +118,7 @@ export struct DetailPlayLivePage {
}
getLiveDetails() {
const data = this.liveDetailsBean
const data = this.contentDetailData
if (data.liveInfo?.liveState == 'wait') {
//直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】
if (data.liveInfo?.liveStyle == 1) {
... ...
import { Action, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index';
import { LiveRoomDataBean } from 'wdBean/Index';
import { LiveViewModel } from '../viewModel/LiveViewModel';
import router from '@ohos.router';
import { WindowModel } from 'wdKit/Index';
import { PlayerComponent } from '../widgets/vertical/PlayerComponent';
import { PlayerInfoComponent } from '../widgets/vertical/PlayerInfoComponent';
import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index';
import { WDAliPlayerController } from 'wdPlayer/Index';
import { DisplayDirection } from 'wdConstant/Index';
import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index';
import { PlayerEndView } from '../widgets/vertical/PlayerEndView';
... ... @@ -33,7 +32,6 @@ export struct DetailPlayVLivePage {
@Consume @Watch('openFullScreen') pageShow: number
@Consume @Watch('closeFullScreen') pageHide: number
@Consume contentId: string
@Consume liveDetailsBean: LiveDetailsBean
@State swiperIndex: number = 1
aboutToAppear(): void {
... ... @@ -117,5 +115,7 @@ export struct DetailPlayVLivePage {
console.error(TAG, 'getLiveDetails catch', message)
})
}
}
... ...
import font from '@ohos.font'
import { LiveDetailsBean } from 'wdBean/Index'
import { ContentDetailDTO } from 'wdBean/Index'
import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { HttpUtils } from 'wdNetwork/Index'
... ... @@ -7,7 +7,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
@Component
export struct LiveCountdownComponent {
@State liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean
@State liveDetailsBean: ContentDetailDTO = {} as ContentDetailDTO
textTimerController: TextTimerController = new TextTimerController()
@State format: string = 'HH:mm:ss'
@State month: string = ''
... ... @@ -141,7 +141,7 @@ export struct LiveCountdownComponent {
}
//2024-04-01 19:44:00-trim->2024-04-0119:44:00
if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo?.planStartTime)) {
let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime?.trim()
let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime+''
this.month = Number(playStartTimeTmp.substring(5, 7)).toString()
this.day = playStartTimeTmp.substring(8, 10)
this.hour = playStartTimeTmp.substring(11, 13)
... ... @@ -152,7 +152,7 @@ export struct LiveCountdownComponent {
getLiveAppointmentStatus() {
this.liveViewModel.getLiveAppointmentStatus(
this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '',
this.liveDetailsBean.newsId
this.liveDetailsBean.newsId+''
).then(
(data) => {
this.isAppointmentLive = data
... ... @@ -165,7 +165,7 @@ export struct LiveCountdownComponent {
liveAppointment() {
this.liveViewModel.liveAppointment(
this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '',
this.liveDetailsBean.newsId,
this.liveDetailsBean.newsId+'',
!this.isAppointmentLive).then(
(data) => {
if (data.success) {
... ...
import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { EmptyComponent, ErrorComponent, WDViewDefaultType } from 'wdComponent/Index'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout'
... ... @@ -17,7 +17,7 @@ export struct TabChatComponent {
@State private pageModel: PageModel = new PageModel()
liveViewModel: LiveViewModel = new LiveViewModel()
@State liveChatList: Array<LiveRoomItemBean> = []
@Consume liveDetailsBean: LiveDetailsBean
@Consume contentDetailData: ContentDetailDTO
@Consume publishCommentModel: publishCommentModel
aboutToAppear(): void {
... ... @@ -102,8 +102,8 @@ export struct TabChatComponent {
this.pageModel.currentPage = 1
this.liveViewModel.getLiveChatList(
this.pageModel.currentPage,
this.liveDetailsBean?.liveInfo?.mlive?.mliveId,
this.liveDetailsBean?.newsId,
this.contentDetailData?.liveInfo?.mlive?.mliveId,
String( this.contentDetailData.newsId),
20,)
.then(
(data) => {
... ...
import { LiveDetailsBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean } from 'wdBean/Index'
import { LiveCountdownComponent } from './LiveCountdownComponent'
@Component
export struct TabInfoComponent {
@Consume liveDetailsBean: LiveDetailsBean
@Consume contentDetailData: ContentDetailDTO
aboutToAppear(): void {
}
... ... @@ -12,7 +11,7 @@ export struct TabInfoComponent {
Column() {
this.showLiveTitle()
this.showLiveDetails()
LiveCountdownComponent({liveDetailsBean:this.liveDetailsBean})
LiveCountdownComponent({liveDetailsBean:this.contentDetailData})
}.margin({
top: 13,
left: 16,
... ... @@ -27,7 +26,7 @@ export struct TabInfoComponent {
@Builder
showLiveTitle() {
Text(this.liveDetailsBean.newsTitle)
Text(this.contentDetailData.newsTitle)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('18vp')
... ... @@ -38,7 +37,7 @@ export struct TabInfoComponent {
@Builder
showLiveDetails() {
Text(this.liveDetailsBean.newIntroduction)
Text(this.contentDetailData.newIntroduction)
.maxLines(5)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('14vp')
... ...
import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI, WDViewDefaultType } from 'wdComponent/Index'
import { TabLiveItemComponent } from './TabLiveItemComponent'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
... ... @@ -12,12 +12,14 @@ import { Logger } from 'wdKit'
const TAG: string = 'TabLiveComponent';
/**
* 非沉浸式直播间组件
*/
@Component
export struct TabLiveComponent {
liveViewModel: LiveViewModel = new LiveViewModel()
@State liveList: Array<LiveRoomItemBean> = []
@Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
@Consume @Watch('updateData') contentDetailData: ContentDetailDTO
@State private pageModel: PageModel = new PageModel()
aboutToAppear(): void {
... ... @@ -81,15 +83,15 @@ export struct TabLiveComponent {
}
getLiveList() {
if (!this.liveDetailsBean || !this.liveDetailsBean.newsId) {
if (!this.contentDetailData || !this.contentDetailData.newsId) {
// 参数不够,直接拦截接口
return
}
this.pageModel.currentPage = 1
this.liveViewModel.getLiveList(
this.pageModel.currentPage,
this.liveDetailsBean?.liveInfo?.mlive?.mliveId,
this.liveDetailsBean?.newsId,
this.contentDetailData?.liveInfo?.mlive?.mliveId,
this.contentDetailData?.newsId+'',
20)
.then(
(data) => {
... ... @@ -110,16 +112,16 @@ export struct TabLiveComponent {
this.pageModel.hasMore = true;
} else {
this.pageModel.hasMore = false;
if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId)
&& this.liveDetailsBean
&& this.liveDetailsBean.liveInfo.liveState != 'wait') {
if (StringUtils.isEmpty(this.contentDetailData.oldNewsId)
&& this.contentDetailData
&& this.contentDetailData.liveInfo.liveState != 'wait') {
this.updateLiveListData()
}
}
} else {
if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId)
&& this.liveDetailsBean
&& this.liveDetailsBean.liveInfo.liveState != 'wait') {
if (StringUtils.isEmpty(this.contentDetailData.oldNewsId)
&& this.contentDetailData
&& this.contentDetailData.liveInfo.liveState != 'wait') {
this.pageModel.viewType = ViewType.LOADED;
this.updateLiveListData()
} else {
... ... @@ -136,12 +138,12 @@ export struct TabLiveComponent {
updateLiveListData() {
let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean
liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction
liveRoomItemBeanTemp.text = this.contentDetailData.newIntroduction
liveRoomItemBeanTemp.senderUserName = '人民日报主持人'
liveRoomItemBeanTemp.pictureUrls = []
liveRoomItemBeanTemp.pictureUrls.push(this.liveDetailsBean?.fullColumnImgUrls[0]?.url)
liveRoomItemBeanTemp.pictureUrls.push(this.contentDetailData?.fullColumnImgUrls[0]?.url)
liveRoomItemBeanTemp.dataType = 'ZH_TEXT_AND_IMAGE_MSG'
let temp = this.liveDetailsBean?.fullColumnImgUrls[0]
let temp = this.contentDetailData?.fullColumnImgUrls[0]
if (temp) {
liveRoomItemBeanTemp.pictureResolutions = []
liveRoomItemBeanTemp.pictureResolutions.push(`${temp.height}*${temp.weight}`)
... ...
... ... @@ -3,7 +3,7 @@ import lottie from '@ohos/lottie';
import { NumberFormatterUtils, StringUtils, WindowModel } from 'wdKit/Index'
import { DateFormatUtil, WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index'
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { DisplayDirection } from 'wdConstant/Index'
import { LiveFollowComponent, LottieView } from 'wdComponent/Index'
... ... @@ -12,7 +12,8 @@ export struct PlayUIComponent {
playerController?: WDAliPlayerController;
//菜单键是否可见
@State @Watch('onChangeMenuVisible') isMenuVisible: boolean = true
@Consume liveDetailsBean: LiveDetailsBean
// @Consume liveDetailsBean: LiveDetailsBean
@Consume contentDetailData: ContentDetailDTO
@Consume liveRoomDataBean: LiveRoomDataBean
@State currentTime: string = ''
@State totalTime: string = ''
... ... @@ -24,8 +25,8 @@ export struct PlayUIComponent {
@Prop isShowBottom: boolean
onChangeMenuVisible() {
if (!this.liveDetailsBean || !this.liveDetailsBean.liveInfo ||
this.liveDetailsBean?.liveInfo?.liveState === 'wait') {
if (!this.contentDetailData || !this.contentDetailData.liveInfo ||
this.contentDetailData?.liveInfo?.liveState === 'wait') {
return
}
let time: number = 0
... ... @@ -51,14 +52,14 @@ export struct PlayUIComponent {
}
aboutToDisappear(): void {
if (this.liveDetailsBean.liveInfo?.liveState == 'running') {
if (this.contentDetailData.liveInfo?.liveState == 'running') {
lottie.destroy('live_status_wait')
}
}
build() {
Column() {
if (this.liveDetailsBean && this.liveDetailsBean.liveInfo) {
if (this.contentDetailData && this.contentDetailData.liveInfo) {
this.getTopUIComponent()
this.getMiddleUIComponent()
if(this.isShowBottom){
... ... @@ -92,8 +93,8 @@ export struct PlayUIComponent {
// window.Orientation.PORTRAIT :
// window.Orientation.LANDSCAPE);
})
if (this.liveDetailsBean.liveInfo?.liveState != 'wait') {
Text(this.liveDetailsBean.newsTitle)
if (this.contentDetailData.liveInfo?.liveState != 'wait') {
Text(this.contentDetailData.newsTitle)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.MARQUEE })
.fontSize(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '18vp' : '16vp')
... ... @@ -116,9 +117,9 @@ export struct PlayUIComponent {
})
Row() {
if (this.liveDetailsBean?.rmhInfo) {
if (this.contentDetailData?.rmhInfo) {
LiveFollowComponent({
rmhInfo: this.liveDetailsBean.rmhInfo
rmhInfo: this.contentDetailData.rmhInfo
})
.margin({
right: 10
... ... @@ -144,7 +145,7 @@ export struct PlayUIComponent {
getLiveStatusView() {
// 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
// 预约
if (this.liveDetailsBean.liveInfo?.liveState == 'wait') {
if (this.contentDetailData.liveInfo?.liveState == 'wait') {
Row() {
Image($r('app.media.icon_live_status_wait'))
... ... @@ -163,7 +164,7 @@ export struct PlayUIComponent {
})
}
// 直播中
else if (this.liveDetailsBean.liveInfo?.liveState == 'running') {
else if (this.contentDetailData.liveInfo?.liveState == 'running') {
Row() {
Stack() {
Image($r('app.media.icon_live_status_running_back'))
... ... @@ -204,7 +205,7 @@ export struct PlayUIComponent {
})
}
//回看
else if (this.liveDetailsBean.liveInfo?.liveState == 'end') {
else if (this.contentDetailData.liveInfo?.liveState == 'end') {
Row() {
Text('回看')
.fontSize('11vp')
... ... @@ -240,7 +241,7 @@ export struct PlayUIComponent {
.layoutWeight(1)
.width('100%')
.onClick(() => {
if (this.liveDetailsBean?.liveInfo?.liveState === 'wait') {
if (this.contentDetailData?.liveInfo?.liveState === 'wait') {
return
}
this.isMenuVisible = !this.isMenuVisible
... ... @@ -250,13 +251,13 @@ export struct PlayUIComponent {
@Builder
getBottomUIComponent() {
Row() {
if (this.liveDetailsBean?.liveInfo?.liveState == 'wait') {
if (this.contentDetailData?.liveInfo?.liveState == 'wait') {
Blank()
} else if (this.liveDetailsBean?.liveInfo?.liveState == 'running') {
} else if (this.contentDetailData?.liveInfo?.liveState == 'running') {
this.playOrPauseBtn()
Blank()
} else if (this.liveDetailsBean?.liveInfo?.liveState == 'end') {
if (StringUtils.isEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri)) {
} else if (this.contentDetailData?.liveInfo?.liveState == 'end') {
if (StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri)) {
Blank()
} else {
this.playOrPauseBtn()
... ... @@ -277,9 +278,9 @@ export struct PlayUIComponent {
})
}
}
if (this.liveDetailsBean?.liveInfo?.liveState == 'running'
|| (this.liveDetailsBean?.liveInfo?.liveState == 'end' &&
StringUtils.isNotEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri))
if (this.contentDetailData?.liveInfo?.liveState == 'running'
|| (this.contentDetailData?.liveInfo?.liveState == 'end' &&
StringUtils.isNotEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri))
) {
Image($r('app.media.icon_live_player_full_screen'))
.width(24)
... ...
import { LiveDetailsBean } from 'wdBean/Index';
import { ContentDetailDTO, LiveDetailsBean } from 'wdBean/Index';
import { Logger, StringUtils } from 'wdKit/Index';
import { PlayerConstants, WDAliPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
import { PlayUIComponent } from './PlayUIComponent';
... ... @@ -6,10 +6,12 @@ import { PictureLoading } from '../../vertical/PictureLoading';
const TAG: string = 'TopPlayComponent'
/**
* 非沉浸式直播 --- 顶部播放器组件
*/
@Component
export struct TopPlayComponent {
@Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
@Consume @Watch('updateData') contentDetailData: ContentDetailDTO
playerController?: WDAliPlayerController
@State imgUrl: string = ''
//未开始
... ... @@ -55,26 +57,26 @@ export struct TopPlayComponent {
updateData() {
//直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.previewUrl &&
this.liveDetailsBean.liveInfo.previewUrl.length > 0) {
this.imgUrl = this.liveDetailsBean.liveInfo.previewUrl
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl &&
this.contentDetailData.liveInfo.previewUrl.length > 0) {
this.imgUrl = this.contentDetailData.liveInfo.previewUrl
Logger.debug(TAG, 'ok+' + `${this.imgUrl}`)
} else if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) {
this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
} else if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) {
this.imgUrl = this.contentDetailData.fullColumnImgUrls[0].url
Logger.debug(TAG, 'ok-' + `${this.imgUrl}`)
}
this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait'
this.isWait = this.contentDetailData?.liveInfo?.liveState == 'wait'
if(this.isWait ){
this.isLoading = true
}
this.isEnd = this.liveDetailsBean?.liveInfo?.liveState === 'end' &&
StringUtils.isEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri)
if (!this.isWait && this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) {
this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' &&
StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri)
if (!this.isWait && this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) {
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
if (this.contentDetailData.liveInfo.liveState == 'running') {
playUrl = this.contentDetailData.liveInfo.vlive[0].liveUrl
} else if (this.contentDetailData.liveInfo.liveState == 'end') {
playUrl = this.contentDetailData.liveInfo.vlive[0].replayUri
}
// this.playerController?.firstPlay('https://rmrbcmsonline.peopleapp.com/upload/rmh/video/mp4/202404/1713752415708fb81d0b8f137b.mp4');
if (StringUtils.isNotEmpty(playUrl)) {
... ...
import { LiveDetailsBean } from 'wdBean/Index'
import { ContentDetailDTO } from 'wdBean/Index'
@Component
export struct ChartItemCompereComponent {
@Consume liveDetailsBean: LiveDetailsBean
// @Consume liveDetailsBean: LiveDetailsBean
@Consume contentDetailData: ContentDetailDTO
aboutToAppear(): void {
}
... ... @@ -32,7 +32,7 @@ export struct ChartItemCompereComponent {
.margin({ bottom: 8 })
.justifyContent(FlexAlign.Start)
Text(this.liveDetailsBean.newIntroduction).lineHeight(22).fontColor('#FFFFFFFF').fontSize(14)
Text(this.contentDetailData.newIntroduction).lineHeight(22).fontColor('#FFFFFFFF').fontSize(14)
}
.backgroundColor('#4D000000')
.borderRadius(3)
... ...
... ... @@ -17,12 +17,11 @@ const TAG = "PlayerCommentComponent"
@Component
export struct PlayerCommentComponent {
liveViewModel: LiveViewModel = new LiveViewModel()
@Consume @Watch('liveDetailsBeanChange') liveDetailsBean: LiveDetailsBean
@Consume liveRoomDataBean: LiveRoomDataBean
@Consume displayDirection: DisplayDirection
@State private pageModel: PageModel = new PageModel()
@State liveChatList: Array<LiveRoomItemBean> = []
@Consume contentDetailData: ContentDetailDTO
@Consume @Watch('liveDetailsBeanChange') contentDetailData: ContentDetailDTO
@Consume publishCommentModel: publishCommentModel
scroller: Scroller = new Scroller()
... ... @@ -65,8 +64,8 @@ export struct PlayerCommentComponent {
this.pageModel.currentPage = 1
this.liveViewModel.getLiveChatList(
1,
this.liveDetailsBean?.liveInfo?.mlive?.mliveId,
this.liveDetailsBean?.newsId,
this.contentDetailData?.liveInfo?.mlive?.mliveId,
this.contentDetailData?.newsId+'',
20,)
.then(
(data) => {
... ... @@ -98,7 +97,7 @@ export struct PlayerCommentComponent {
Column() {
List({ scroller: this.scroller }) {
// 主持人
if (this.liveDetailsBean.oldNewsId) {
if (this.contentDetailData.oldNewsId) {
ChartItemCompereComponent()
}
ForEach(this.liveChatList, (item: LiveRoomItemBean) => {
... ...
import { LiveDetailsBean } from 'wdBean/Index';
import { WDPlayerController, WDPlayerRenderVLiveView, WDPlayerRenderView, WDAliPlayerController,
AliPlayerRenderView } from 'wdPlayer/Index';
import { ContentDetailDTO } from 'wdBean/Index';
import { AliPlayerRenderView, WDAliPlayerController, WDPlayerRenderVLiveView } from 'wdPlayer/Index';
import { PictureLoading } from './PictureLoading';
const TAG = 'PlayerComponent'
... ... @@ -8,7 +7,7 @@ const TAG = 'PlayerComponent'
@Component
export struct PlayerComponent {
@Prop playerController: WDAliPlayerController;
@Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
@Consume @Watch('updateData') contentDetailData: ContentDetailDTO
@Consume @Watch('pageShowChange') pageShow: number
@Consume @Watch('pageHideChange') pageHide: number
@Consume isShowControl: boolean
... ... @@ -21,7 +20,6 @@ export struct PlayerComponent {
@State playUrl: string = ''
@State isCanplay: boolean = false
pageShowChange() {
this.playerController?.play()
}
... ... @@ -42,19 +40,19 @@ export struct PlayerComponent {
updateData() {
//直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) {
this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) {
this.imgUrl = this.contentDetailData.fullColumnImgUrls[0].url
}
this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait'
if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) {
this.isWait = this.contentDetailData?.liveInfo?.liveState == 'wait'
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) {
let playUrl = ''
let liveStreamType: number | null = null
if (this.liveDetailsBean.liveInfo.liveState == 'running') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl
liveStreamType = this.liveDetailsBean.liveInfo.vlive[0].liveStreamType
} else if (this.liveDetailsBean.liveInfo.liveState == 'end') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
liveStreamType = this.liveDetailsBean.liveInfo.vlive[0].liveStreamType
if (this.contentDetailData.liveInfo.liveState == 'running') {
playUrl = this.contentDetailData.liveInfo.vlive[0].liveUrl
liveStreamType = this.contentDetailData.liveInfo.vlive[0].liveStreamType
} else if (this.contentDetailData.liveInfo.liveState == 'end') {
playUrl = this.contentDetailData.liveInfo.vlive[0].replayUri
liveStreamType = this.contentDetailData.liveInfo.vlive[0].liveStreamType
}
this.liveStreamType = liveStreamType
... ... @@ -79,7 +77,7 @@ export struct PlayerComponent {
playerController: this.playerController,
onLoad: () => {
this.isCanplay = true
console.error('WDAliPlayerController','------1------------')
console.error('WDAliPlayerController', '------1------------')
this.playerController?.firstPlay(this.playUrl);
}
}).margin({ top: 195 }).height(211)
... ... @@ -102,6 +100,4 @@ export struct PlayerComponent {
.height('100%')
.width('100%')
}
}
\ No newline at end of file
... ...
import { LiveDetailsBean, LiveRoomDataBean, postBatchAttentionStatusParams, } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean, postBatchAttentionStatusParams, } from 'wdBean/Index'
import { MultiPictureDetailViewModel } from 'wdComponent/src/main/ets/viewmodel/MultiPictureDetailViewModel'
import { SpConstants } from 'wdConstant/Index'
import { ContentDetailRequest, postInteractAccentionOperateParams } from 'wdDetailPlayApi/Index'
... ... @@ -10,14 +10,15 @@ const TAG = 'PlayerEndView'
@Preview
@Component
export struct PlayerEndView {
@Consume liveDetailsBean: LiveDetailsBean
// @Consume liveDetailsBean: LiveDetailsBean
@Consume contentDetailData: ContentDetailDTO
@Consume liveRoomDataBean: LiveRoomDataBean
@State duration: string = ''
@State followStatus: String = '0';
aboutToAppear(): void {
const sn = DateTimeUtils.parseDate(this.liveDetailsBean.liveInfo.startTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
const en = DateTimeUtils.parseDate(this.liveDetailsBean.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
const sn = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.startTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
const en = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
const sd = DateTimeUtils.getDuration(sn, en)
this.duration = DateTimeUtils.secondToTime(sd / 1000)
this.getBatchAttentionStatus()
... ... @@ -29,7 +30,7 @@ export struct PlayerEndView {
async getBatchAttentionStatus() {
try {
const params: postBatchAttentionStatusParams = {
creatorIds: [{ creatorId: this.liveDetailsBean?.rmhInfo?.rmhId ?? '' }]
creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
}
let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params)
this.followStatus = data[0]?.status;
... ... @@ -51,9 +52,9 @@ export struct PlayerEndView {
}
// TODO:直播间没有携带人民号信息
const params2: postInteractAccentionOperateParams = {
attentionUserType: this.liveDetailsBean?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
attentionUserId: this.liveDetailsBean?.rmhInfo?.userId || '', // 被关注用户号主id
attentionCreatorId: this.liveDetailsBean?.rmhInfo?.rmhId || '', // 被关注用户号主id
attentionUserType: this.contentDetailData?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
attentionUserId: this.contentDetailData?.rmhInfo?.userId || '', // 被关注用户号主id
attentionCreatorId: this.contentDetailData?.rmhInfo?.rmhId || '', // 被关注用户号主id
status: this.followStatus == '0' ? 1 : 0,
}
... ... @@ -79,12 +80,12 @@ export struct PlayerEndView {
Stack() {
Column() {
Text(this.liveDetailsBean?.rmhInfo?.rmhName)
Text(this.contentDetailData?.rmhInfo?.rmhName)
.fontWeight(400)
.fontSize(18)
.fontColor(Color.White)
.padding({ top: 52 })
Text(this.liveDetailsBean?.rmhInfo?.rmhDesc || '')
Text(this.contentDetailData?.rmhInfo?.rmhDesc || '')
.fontWeight(400)
.fontSize(13)
.fontColor('#B2FFFFFF')
... ... @@ -127,7 +128,7 @@ export struct PlayerEndView {
.backgroundColor('#999999')
.borderRadius(4)
Image(this.liveDetailsBean?.fullColumnImgUrls[0]?.url)
Image(this.contentDetailData?.fullColumnImgUrls[0]?.url)
.width(80)
.height(80)
.borderRadius(40)
... ...
import lottie from '@ohos/lottie'
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { LiveFollowComponent, LottieView } from 'wdComponent/Index'
import { NumberFormatterUtils } from 'wdKit/Index'
@Preview
@Component
export struct PlayerTitleComponent {
@Consume liveDetailsBean: LiveDetailsBean
// @Consume liveDetailsBean: LiveDetailsBean
@Consume liveRoomDataBean: LiveRoomDataBean
@Consume liveState: string
@Consume contentDetailData: ContentDetailDTO
aboutToDisappear(): void {
if (this.liveDetailsBean.liveInfo?.liveState == 'running') {
if (this.contentDetailData.liveInfo?.liveState == 'running') {
lottie.destroy('live_status_wait')
}
}
... ... @@ -19,7 +19,7 @@ export struct PlayerTitleComponent {
build() {
Column() {
Row() {
Text(this.liveDetailsBean.newsTitle || '')
Text(this.contentDetailData.newsTitle || '')
.maxLines(2)
.fontSize(16)
.fontWeight(500)
... ... @@ -42,9 +42,9 @@ export struct PlayerTitleComponent {
@Builder
getLiveStatusView() {
if (this.liveDetailsBean.rmhInfo?.rmhName) {
if (this.contentDetailData.rmhInfo?.rmhName) {
LiveFollowComponent({
rmhInfo: this.liveDetailsBean.rmhInfo
rmhInfo: this.contentDetailData.rmhInfo
}).margin({
right: 10
})
... ...
import { window } from '@kit.ArkUI'
import { NumberFormatterUtils, WindowModel } from 'wdKit/Index'
import { devicePLSensorManager } from 'wdDetailPlayApi/Index'
import { DateFormatUtil, WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index'
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { DateFormatUtil, WDAliPlayerController } from 'wdPlayer/Index'
import { LiveRoomDataBean } from 'wdBean/Index'
@Component
export struct PlayerVideoControlComponent {
private playerController?: WDAliPlayerController
@Consume liveDetailsBean: LiveDetailsBean
@Consume liveRoomDataBean: LiveRoomDataBean
@State currentTime: string = ''
@State totalTime: string = ''
... ...