yanlu

fix: 16727 功能缺陷--预约图片和android 显示不一致

... ... @@ -180,6 +180,8 @@ export interface LiveInfo {
liveStyle: number;
vlive: Array<Vlive>
mlive: MLive
// 背景图片先取这个?
previewUrl: string
}
export interface MLive {
... ...
... ... @@ -4,9 +4,11 @@ import { WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
import { PlayUIComponent } from './PlayUIComponent';
import { Logger } from 'wdKit/Index';
const TAG: string = 'TopPlayComponent'
@Component
export struct TopPlayComponent {
TAG: string = 'TopPlayComponent'
@Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
playerController?: WDPlayerController
@State imgUrl: string = ''
... ... @@ -25,8 +27,13 @@ export struct TopPlayComponent {
updateData() {
//直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) {
if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.previewUrl && this.liveDetailsBean.liveInfo.previewUrl.length > 0) {
this.imgUrl = this.liveDetailsBean.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
Logger.debug(TAG, 'ok-' + `${this.imgUrl}`)
}
this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait'
this.isEnd = this.liveDetailsBean?.liveInfo?.liveState === 'end' &&
... ... @@ -40,7 +47,7 @@ export struct TopPlayComponent {
}
// this.playerController?.firstPlay('https://rmrbcmsonline.peopleapp.com/upload/rmh/video/mp4/202404/1713752415708fb81d0b8f137b.mp4');
if (StringUtils.isNotEmpty(playUrl)) {
Logger.debug('TopPlayComponent', `${playUrl}`)
Logger.debug(TAG, `${playUrl}`)
this.playerController?.firstPlay(playUrl);
}
}
... ... @@ -57,9 +64,10 @@ export struct TopPlayComponent {
.width('100%')
.visibility(this.isWait ? Visibility.None : Visibility.Visible)
Image(this.imgUrl)
.objectFit(ImageFit.Contain)
.objectFit(ImageFit.Cover)
.visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None)
.contrast(this.isEnd ? 0.2 : 1)
.width('100%')
PlayUIComponent({ playerController: this.playerController })
Text('直播已结束')
.fontSize('20fp')
... ...