mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-16 09:36:16 -08:00
Refactor Control class to update control option variables and element references
This commit is contained in:
1 parent
bb3fc27427
commit
cebbb6ec29
4 files changed
+17
-71
No files matched your search
@@ -70,7 +70,8 @@ export default function artplayerPluginDashControl(option = {}) {
|
||||
dash.setQualityFor('video', item.value);
|
||||
}
|
||||
art.notice.show = `${title}: ${item.html}`;
|
||||
art.emit('artplayerPluginDashControl:quality', item);
|
||||
if (config.control) art.controls.check(item);
|
||||
if (config.setting) art.setting.check(item);
|
||||
return item.html;
|
||||
};
|
||||
|
||||
@@ -82,11 +83,6 @@ export default function artplayerPluginDashControl(option = {}) {
|
||||
style: { padding: '0 10px' },
|
||||
selector: selector,
|
||||
onSelect: onSelect,
|
||||
mounted: () => {
|
||||
art.on('artplayerPluginDashControl:quality', (item) => {
|
||||
art.controls.check(item);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -99,11 +95,6 @@ export default function artplayerPluginDashControl(option = {}) {
|
||||
width: 200,
|
||||
selector: selector,
|
||||
onSelect: onSelect,
|
||||
mounted: () => {
|
||||
art.on('artplayerPluginDashControl:quality', (item) => {
|
||||
art.setting.check(item);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -134,7 +125,8 @@ export default function artplayerPluginDashControl(option = {}) {
|
||||
dash.setCurrentTrack(item.value);
|
||||
art.loading.show = true;
|
||||
art.notice.show = `${title}: ${item.html}`;
|
||||
art.emit('artplayerPluginDashControl:audio', item);
|
||||
if (config.control) art.controls.check(item);
|
||||
if (config.setting) art.setting.check(item);
|
||||
return item.html;
|
||||
};
|
||||
|
||||
@@ -146,11 +138,6 @@ export default function artplayerPluginDashControl(option = {}) {
|
||||
style: { padding: '0 10px' },
|
||||
selector: selector,
|
||||
onSelect: onSelect,
|
||||
mounted: () => {
|
||||
art.on('artplayerPluginDashControl:audio', (item) => {
|
||||
art.controls.check(item);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -163,11 +150,6 @@ export default function artplayerPluginDashControl(option = {}) {
|
||||
width: 200,
|
||||
selector: selector,
|
||||
onSelect: onSelect,
|
||||
mounted: () => {
|
||||
art.on('artplayerPluginDashControl:audio', (item) => {
|
||||
art.setting.check(item);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,8 @@ export default function artplayerPluginHlsControl(option = {}) {
|
||||
const onSelect = (item) => {
|
||||
hls.currentLevel = item.value;
|
||||
art.notice.show = `${title}: ${item.html}`;
|
||||
art.emit('artplayerPluginHlsControl:quality', item);
|
||||
if (config.control) art.controls.check(item);
|
||||
if (config.setting) art.setting.check(item);
|
||||
return item.html;
|
||||
};
|
||||
|
||||
@@ -59,11 +60,6 @@ export default function artplayerPluginHlsControl(option = {}) {
|
||||
style: { padding: '0 10px' },
|
||||
selector: selector,
|
||||
onSelect: onSelect,
|
||||
mounted: () => {
|
||||
art.on('artplayerPluginHlsControl:quality', (item) => {
|
||||
art.controls.check(item);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -76,11 +72,6 @@ export default function artplayerPluginHlsControl(option = {}) {
|
||||
width: 200,
|
||||
selector: selector,
|
||||
onSelect: onSelect,
|
||||
mounted: () => {
|
||||
art.on('artplayerPluginHlsControl:quality', (item) => {
|
||||
art.setting.check(item);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -110,7 +101,8 @@ export default function artplayerPluginHlsControl(option = {}) {
|
||||
hls.audioTrack = item.value;
|
||||
art.loading.show = true;
|
||||
art.notice.show = `${title}: ${item.html}`;
|
||||
art.emit('artplayerPluginHlsControl:audio', item);
|
||||
if (config.control) art.controls.check(item);
|
||||
if (config.setting) art.setting.check(item);
|
||||
return item.html;
|
||||
};
|
||||
|
||||
@@ -122,11 +114,6 @@ export default function artplayerPluginHlsControl(option = {}) {
|
||||
style: { padding: '0 10px' },
|
||||
selector: selector,
|
||||
onSelect: onSelect,
|
||||
mounted: () => {
|
||||
art.on('artplayerPluginHlsControl:audio', (item) => {
|
||||
art.controls.check(item);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -139,11 +126,6 @@ export default function artplayerPluginHlsControl(option = {}) {
|
||||
width: 200,
|
||||
selector: selector,
|
||||
onSelect: onSelect,
|
||||
mounted: () => {
|
||||
art.on('artplayerPluginHlsControl:audio', (item) => {
|
||||
art.setting.check(item);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user