LiveDetailPageLogic.ets
1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { ContentDetailDTO } from 'wdBean/Index'
/**
* 直播信息对象逻辑加工处理的工具类
*/
export class LiveDetailPageLogic {
// 直播状态
liveState: string = ''
// 横屏或竖屏 general-竖屏,news-横屏
liveLandscape: string = ''
// 直播样式 0-正常模式,1-隐藏直播 2-隐藏大家聊
liveStyle: number = -1
// 预告片图片/视频url
imgUrl: string = ''
/**
* 直播详情页面,展示的直播信息对象
*/
contentDetailData: ContentDetailDTO = new ContentDetailDTO
/**
* 横屏直播
* @returns true:横屏直播;false:竖屏直播
*/
isLangScapeScreenVideo(): boolean {
return this.liveState === 'wait' || this.liveLandscape === 'news'
}
/**
* 竖屏直播
* @returns
*/
isVerticalScreenVideo(): boolean {
return this.liveLandscape === 'general'
}
/**
* 解析背景图片资源
*/
resolvingRoomBackgroundImgUrl() {
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
}
}
}