mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-14 00:06:17 -08:00
56 lines
1.4 KiB
JavaScript
56 lines
1.4 KiB
JavaScript
import Component from '../utils/component';
|
|
import flip from './flip';
|
|
import aspectRatio from './aspectRatio';
|
|
import playbackRate from './playbackRate';
|
|
|
|
export default class Setting extends Component {
|
|
constructor(art) {
|
|
super(art);
|
|
|
|
this.name = 'setting';
|
|
|
|
const {
|
|
option,
|
|
template: { $setting, $settingBody },
|
|
events: { proxy },
|
|
} = art;
|
|
|
|
this.$parent = $settingBody;
|
|
|
|
if (option.setting) {
|
|
art.on('ready', () => {
|
|
proxy($setting, 'click', e => {
|
|
if (e.target === $setting) {
|
|
this.show = false;
|
|
}
|
|
});
|
|
|
|
this.add(
|
|
flip({
|
|
disable: !option.flip,
|
|
name: 'flip',
|
|
}),
|
|
);
|
|
|
|
this.add(
|
|
aspectRatio({
|
|
disable: !option.aspectRatio,
|
|
name: 'aspectRatio',
|
|
}),
|
|
);
|
|
|
|
this.add(
|
|
playbackRate({
|
|
disable: !option.playbackRate,
|
|
name: 'playbackRate',
|
|
}),
|
|
);
|
|
});
|
|
|
|
art.on('blur', () => {
|
|
this.show = false;
|
|
});
|
|
}
|
|
}
|
|
}
|