mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 17:01:20 -08:00
Refactor Artplayer class to remove unnecessary CSS transformations in setting.less
This commit is contained in:
1 parent
ed88c73ab2
commit
c82e381aa1
10 files changed
+122
-189
No files matched your search
@@ -46,12 +46,8 @@ export default function artplayerPluginHlsControl(option = {}) {
|
||||
|
||||
const onSelect = (item) => {
|
||||
hls.currentLevel = item.value;
|
||||
art.loading.show = true;
|
||||
art.notice.show = `${title}: ${item.html}`;
|
||||
art.emit('artplayerPluginHlsControl:quality', item);
|
||||
for (let index = 0; index < selector.length; index++) {
|
||||
selector[index].default = selector[index] === item;
|
||||
}
|
||||
return item.html;
|
||||
};
|
||||
|
||||
@@ -84,17 +80,9 @@ export default function artplayerPluginHlsControl(option = {}) {
|
||||
width: 200,
|
||||
selector: selector,
|
||||
onSelect: onSelect,
|
||||
mounted: (_, setting) => {
|
||||
mounted: () => {
|
||||
art.on('artplayerPluginHlsControl:quality', (item) => {
|
||||
setting.tooltip = item.html;
|
||||
|
||||
const element = setting.selector.find(
|
||||
(element) => Number(element.$item?.dataset?.value) === item.value,
|
||||
);
|
||||
|
||||
if (element?.$item) {
|
||||
inverseClass(element.$item, 'art-current');
|
||||
}
|
||||
art.setting.check(item);
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -127,9 +115,6 @@ export default function artplayerPluginHlsControl(option = {}) {
|
||||
art.loading.show = true;
|
||||
art.notice.show = `${title}: ${item.html}`;
|
||||
art.emit('artplayerPluginHlsControl:audio', item);
|
||||
for (let index = 0; index < selector.length; index++) {
|
||||
selector[index].default = selector[index] === item;
|
||||
}
|
||||
return item.html;
|
||||
};
|
||||
|
||||
@@ -162,17 +147,9 @@ export default function artplayerPluginHlsControl(option = {}) {
|
||||
width: 200,
|
||||
selector: selector,
|
||||
onSelect: onSelect,
|
||||
mounted: (_, setting) => {
|
||||
mounted: () => {
|
||||
art.on('artplayerPluginHlsControl:audio', (item) => {
|
||||
setting.tooltip = item.html;
|
||||
|
||||
const element = setting.selector.find(
|
||||
(element) => Number(element.$item?.dataset?.value) === item.value,
|
||||
);
|
||||
|
||||
if (element?.$item) {
|
||||
inverseClass(element.$item, 'art-current');
|
||||
}
|
||||
art.setting.check(item);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user