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-03 18:27:57 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a130f613349a9d1b2578bc5e802885d6a7a1c103
a130f613
1 parent
7edac2e1
feat:竖屏直播,进入竖屏直播,未设置垫片-竖屏流直播详情页,后台点击切换到垫片,主播暂时离开,马上回来 缺省图没有显示,看图
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
22 deletions
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveDetailPageLogic.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
View file @
a130f61
...
...
@@ -7,7 +7,7 @@ import { DetailPlayVLivePage } from './DetailPlayVLivePage';
import { DateTimeUtils, Logger, ToastUtils } from 'wdKit/Index';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { PictureLoading } from '../widgets/vertical/PictureLoading';
import { TrackConstants, Tracking
Button, Tracking
PageBrowse } from 'wdTracking/Index';
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
const TAG = 'DetailPlayLiveCommon'
...
...
@@ -36,8 +36,7 @@ export struct DetailPlayLiveCommon {
@Provide liveStyle: number = -1
// 直播地址
@Provide playUrl: string = ''
// // 直播间背景图
// @Provide imgUrl: string = ''
// 全屏展示
@Provide pageShow: number = -1
// 关闭全屏
...
...
@@ -45,7 +44,6 @@ export struct DetailPlayLiveCommon {
// 返回功能
@Provide pageBackPress: number = -1
@Provide liveDetailPageLogic :LiveDetailPageLogic = new LiveDetailPageLogic
// 直播详情内容
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
...
...
@@ -106,20 +104,22 @@ export struct DetailPlayLiveCommon {
let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url
detailData.liveInfo.vlive[0].liveUrl = m3u8uUrl
this.playUrl = m3u8uUrl
// console.log(TAG, ' GetPullAddressBean:', m3u8uUrl)
}
}
this.liveState = detailData.liveInfo?.liveState
this.contentDetailData = data[0]
this.liveDetailPageLogic.contentDetailData = this.contentDetailData
this.liveDetailPageLogic.liveLandscape = detailData?.liveInfo?.liveLandScape
this.liveDetailPageLogic.liveState = detailData.liveInfo?.liveState
this.liveDetailPageLogic.resolvingRoomBackgroundImgUrl()
this.liveDetailPageLogic.resolvingRoomImgSource()
this.liveDetailPageLogic.resolvingRoomVliveData(0)
this.publishCommentModel.targetId = String(detailData?.newsId || '')
this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '')
...
...
@@ -131,13 +131,6 @@ export struct DetailPlayLiveCommon {
this.publishCommentModel.visitorComment = String(detailData?.visitorComment || '')
this.publishCommentModel.commentContent = ''
this.liveStyle = detailData.liveInfo?.liveStyle
//
// if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl &&
// this.contentDetailData.liveInfo.previewUrl.length > 0) {
// this.imgUrl = this.contentDetailData.liveInfo.previewUrl
// } else if (detailData.fullColumnImgUrls && detailData.fullColumnImgUrls.length > 0) {
// this.imgUrl = detailData.fullColumnImgUrls[0].url
// }
if (detailData.liveInfo.liveState == 'end') {
this.playUrl = detailData.liveInfo.vlive[0].replayUri
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
View file @
a130f61
...
...
@@ -35,8 +35,7 @@ export struct DetailPlayVLivePage {
@Consume @Watch('closeFullScreen') pageHide: number
@Consume contentId: string
@State swiperIndex: number = 1
@Consume liveDetailPageLogic :LiveDetailPageLogic
@Consume liveDetailPageLogic: LiveDetailPageLogic
aboutToAppear(): void {
this.openFullScreen()
...
...
@@ -62,7 +61,7 @@ export struct DetailPlayVLivePage {
build() {
Stack() {
Stack(
{ alignContent: Alignment.Top }
) {
// 直播背景图,模糊处理
Image(this.liveDetailPageLogic.imgUrl)
.height('100%')
...
...
@@ -79,13 +78,34 @@ export struct DetailPlayVLivePage {
LiveEmptyComponent({
emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
})
.height('60%')
.height('30%').margin({top:this.topSafeHeight })
} else {
if (this.liveDetailPageLogic.showPad) {
// 有垫片
if(this.liveDetailPageLogic.padImageUri.length > 0){
// 配置了垫片资源
Image(this.liveDetailPageLogic.padImageUri).objectFit(ImageFit.Fill).width('100%').height('100%')
}else {
// 没有配置垫片资源
LiveEmptyComponent({
emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
})
.height('30%').margin({top:this.topSafeHeight })
}
} else {
// 播放器
PlayerComponent({
playerController: this.playerController
})
}
}
// 直播详情 左右滑动业务数据
PlayerInfoComponent({
playerController: this.playerController,
swiperController: this.swiperController,
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveDetailPageLogic.ets
View file @
a130f61
import { ContentDetailDTO } from 'wdBean/Index'
const TAG = 'LiveDetailPageLogic'
/**
* 直播信息对象逻辑加工处理的工具类
*/
...
...
@@ -14,6 +14,10 @@ export class LiveDetailPageLogic {
// 预告片图片/视频url
imgUrl: string = ''
// 垫片资源
padImageUri:string = ''
// 垫片是否开启
showPad:boolean = false
/**
...
...
@@ -42,15 +46,42 @@ export class LiveDetailPageLogic {
/**
* 解析
背景
图片资源
* 解析
直播间的
图片资源
*/
resolvingRoom
BackgroundImgUrl
() {
resolvingRoom
ImgSource
() {
// 背景图资源
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl &&
this.contentDetailData.liveInfo.previewUrl.length > 0) {
this.imgUrl = this.contentDetailData.liveInfo.previewUrl
} else if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) {
this.imgUrl = this.contentDetailData.fullColumnImgUrls[0].url
}
// 垫图资源
if (this.contentDetailData.liveInfo){
if(this.contentDetailData.liveInfo.padImageUri.length > 0){
this.padImageUri =this.contentDetailData.liveInfo.padImageUri
}
//this.padImageUri = 'https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20240515/image/display/cdb84fe86b1440d58f3fc585841b928d.jpg'
}
console.log(TAG, ' this.imgUrl===>', this.imgUrl)
}
/**
* 解析直播详情里面的 vlive资源
* @param index
*/
resolvingRoomVliveData(index:number){
// 只有直播中的才会有垫片
if(this.liveState === 'running'){
this.showPad = this.contentDetailData.liveInfo.vlive[index].showPad
}
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment