remove subtitle control

This commit is contained in:
Harvey committed 2022-05-13 10:07:54 +08:00
1 parent de9005cf20
commit d540b7f32e
13 files changed
+48 -116

No files matched your search

+4 -14
View File
@@ -5,7 +5,6 @@ import fullscreenWeb from './fullscreenWeb';
import pip from './pip';
import playAndPause from './playAndPause';
import progress from './progress';
import subtitle from './subtitle';
import time from './time';
import volume from './volume';
import setting from './setting';
@@ -117,21 +116,12 @@ export default class Control extends Component {
}),
);
this.add(
subtitle({
name: 'subtitle',
disable: !option.subtitle.url,
position: 'right',
index: 30,
}),
);
this.add(
setting({
name: 'setting',
disable: !option.setting,
position: 'right',
index: 40,
index: 30,
}),
);
@@ -140,7 +130,7 @@ export default class Control extends Component {
name: 'pip',
disable: !option.pip,
position: 'right',
index: 50,
index: 40,
}),
);
@@ -149,7 +139,7 @@ export default class Control extends Component {
name: 'fullscreenWeb',
disable: !option.fullscreenWeb,
position: 'right',
index: 60,
index: 50,
}),
);
@@ -158,7 +148,7 @@ export default class Control extends Component {
name: 'fullscreen',
disable: !option.fullscreen,
position: 'right',
index: 70,
index: 60,
}),
);
@@ -1,26 +0,0 @@
import { append, tooltip } from '../utils';
export default function subtitle(option) {
return (art) => ({
...option,
tooltip: art.i18n.get('Hide Subtitle'),
mounted: ($control) => {
const {
events: { proxy },
icons,
i18n,
subtitle,
} = art;
append($control, icons.subtitle);
proxy($control, 'click', () => {
subtitle.toggle = true;
});
art.on('subtitle', (value) => {
tooltip($control, i18n.get(value ? 'Hide Subtitle' : 'Show Subtitle'));
});
},
});
}