mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 13:51:20 -08:00
优化手机端UI
This commit is contained in:
1 parent
19a894fcb6
commit
beea013daf
16 files changed
+249
-129
No files matched your search
@@ -1,9 +1,9 @@
|
||||
import { append, clamp, tooltip, setStyle } from '../utils';
|
||||
|
||||
export default function volume(option) {
|
||||
return art => ({
|
||||
return (art) => ({
|
||||
...option,
|
||||
mounted: $control => {
|
||||
mounted: ($control) => {
|
||||
const {
|
||||
events: { proxy },
|
||||
icons,
|
||||
@@ -21,6 +21,10 @@ export default function volume(option) {
|
||||
tooltip($volume, i18n.get('Mute'));
|
||||
setStyle($volumeClose, 'display', 'none');
|
||||
|
||||
if (art.isMobile) {
|
||||
setStyle($volumePanel, 'display', 'none');
|
||||
}
|
||||
|
||||
function volumeChangeFromEvent(event) {
|
||||
const { left: panelLeft } = $volumePanel.getBoundingClientRect();
|
||||
const percentage =
|
||||
@@ -55,7 +59,7 @@ export default function volume(option) {
|
||||
player.muted = false;
|
||||
});
|
||||
|
||||
proxy($volumePanel, 'click', event => {
|
||||
proxy($volumePanel, 'click', (event) => {
|
||||
player.muted = false;
|
||||
player.volume = volumeChangeFromEvent(event);
|
||||
});
|
||||
@@ -64,7 +68,7 @@ export default function volume(option) {
|
||||
isDroging = true;
|
||||
});
|
||||
|
||||
proxy($control, 'mousemove', event => {
|
||||
proxy($control, 'mousemove', (event) => {
|
||||
if (isDroging) {
|
||||
player.muted = false;
|
||||
player.volume = volumeChangeFromEvent(event);
|
||||
|
||||
Reference in new issue
Block a user