PlayerDetailContainer.ets
1.12 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
/**
* 详情view&播放器view的容器布局组件
*/
@Component
export struct PlayerDetailContainer {
@BuilderParam playerView: () => void
@BuilderParam playControlView: () => void
@BuilderParam detailView: () => void
@Consume isFullScreen: boolean
build() {
RelativeContainer() {
Stack() {
Row() {
this.playerView()
}
.height('100%')
.width('100%')
.zIndex(0)
Row() {
this.playControlView()
}
.height('100%')
.width('100%')
.zIndex(1)
}
.width('100%')
.aspectRatio(this.isFullScreen ? 0 : 16 / 9.0)
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
.id('txt_title')
if (!this.isFullScreen) {
Row() {
this.detailView()
}
.width('100%')
.alignRules({
bottom: { anchor: '__container__', align: VerticalAlign.Bottom }
})
.id('row_bottomView')
}
}
.width('100%')
.height('100%')
}
}