PlayDialog.ets
1.11 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
import { PlayerConstants, SpeedBean } from 'wdPlayer';
// 倍速Dialog
@Preview
@CustomDialog
export struct PlaySpeedDialog {
@Link playSpeed: number;
@Link @Watch('closeDialog') isFullScreen: boolean
controller: CustomDialogController;
closeDialog(propName: string) {
if (this.isFullScreen == false) {
this.controller.close();
}
}
build() {
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
List({ space: '10%', initialIndex: 0 }) {
ForEach(PlayerConstants.SPEED_ARRAY, (item: SpeedBean) => {
ListItem() {
Text(item.text)
.width('100%')
.textAlign(TextAlign.Center)
.fontColor(this.playSpeed == item.value ? Color.Blue : Color.White)
.fontSize(16)
.fontWeight(FontWeight.Medium)
.onClick(() => {
this.playSpeed = item.value;
})
}
})
}
.padding(12)
.alignListItem(ListItemAlign.Center)
}
.width('20%')
.height('100%')
.backgroundColor('rgba(0,0,0,0.8)')
}
}
// 码率..