yumaochao
... ... @@ -166,6 +166,25 @@ export class ProcessUtils {
* @param content
* */
public static gotoMultiPictureListPage(photoList: PhotoListBean[], swiperIndex?: number) {
let tempP = [] as PhotoListBean[]
let relIndex = 0;
for (let index = 0; index < photoList.length; index++) {
const element = photoList[index];
if(!StringUtils.isEmpty(element.picPath)){
relIndex = relIndex+1
}
}
tempP.length = relIndex
relIndex = 0
for (let index = 0; index < photoList.length; index++) {
const element = photoList[index];
if(!StringUtils.isEmpty(element.picPath)){
tempP[relIndex] = element
relIndex = relIndex+1
}
}
photoList.length = tempP.length
photoList = tempP
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
... ...
... ... @@ -50,11 +50,6 @@ export struct DetailPlayLiveCommon {
}
aboutToDisappear(): void {
console.error("XXXXZZZZ", '---aboutToDisappear------------')
}
build() {
Column() {
// 直播预约或横屏直播统一进横屏直播
... ... @@ -84,20 +79,16 @@ export struct DetailPlayLiveCommon {
if (data) {
let detailData = data[0]
//人民号类型单独获取直播地址
if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') {
if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') { //
let vliveId = detailData.liveInfo.vlive[0].vliveId as string
console.error(TAG, 'vliveId==' + vliveId)
let pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean
console.error(TAG, 'vliveId==' + vliveId)
if (pullStreamAddressData) {
console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData))
// console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData))
let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url
detailData.liveInfo.vlive[0].liveUrl = m3u8uUrl
this.playUrl = m3u8uUrl
console.log(TAG, ' GetPullAddressBean:', m3u8uUrl)
// console.log(TAG, ' GetPullAddressBean:', m3u8uUrl)
}
}
this.liveLandscape =
... ...
import { ContentDetailDTO,
import {
ContentDetailDTO,
GetPullAddressBean,
LiveDetailsBean, LiveRoomBean, LiveRoomDataBean,
LiveDetailsBean,
LiveRoomBean,
LiveRoomDataBean,
LiveRoomItemBean,
ValueType } from 'wdBean/Index'
ValueType
} from 'wdBean/Index'
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { Logger } from 'wdKit/Index'
import { ToastUtils } from 'wdKit/src/main/ets/utils/ToastUtils'
... ... @@ -25,26 +29,33 @@ export class LiveViewModel {
//console.error("XXXXZZZZ", '---getContentDetail---1------------')
success(data)
}).catch((message: string) => {
// console.error("XXXXZZZZ", '----getContentDetail--2------------')
// console.error("XXXXZZZZ", '----getContentDetail--2------------')
fail(message)
})
})
}
async getLiveRoomPullAddress(vliveId:string) : Promise<GetPullAddressBean>{
return new Promise<GetPullAddressBean>((success, fail) => {
ContentDetailRequest.getLiveRoomPullStream(vliveId).then(async (resDTO: ResponseDTO<GetPullAddressBean>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
if (resDTO.data) {
success(resDTO.data)
}else {
fail("数据为空")
}
}).catch(() => {
fail("数据为空")
})
/**
* 获取直播间的拉流地址
* @param vliveId
* @returns
*/
async getLiveRoomPullAddress(vliveId: string): Promise<GetPullAddressBean | null> {
return new Promise<GetPullAddressBean | null>((success, fail) => {
ContentDetailRequest.getLiveRoomPullStream(vliveId)
.then(async (resDTO: ResponseDTO<GetPullAddressBean>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
if (resDTO.data) {
success(resDTO.data)
} else {
success(null)
}
})
.catch(() => {
success(null)
})
})
... ... @@ -104,6 +115,7 @@ export class LiveViewModel {
})
})
}
// 直播详情-C端点赞接口
getLiveRoomNumberLike(liveId: string, number: number, deviceId: string | number) {
return new Promise<number>((success, fail) => {
... ... @@ -114,6 +126,7 @@ export class LiveViewModel {
})
})
}
// 直播详情-查询是否点赞接口
getLiveLike(liveId: string, userId: ValueType, deviceId: string | number) {
return new Promise<boolean>((success, fail) => {
... ...
... ... @@ -279,10 +279,10 @@ export struct PlayUIComponent {
})
}
// 进度条
if (this.contentDetailData.liveInfo?.liveState == 'running') {
Blank()
} else {
// 进度条
this.playProgressView()
}
... ...