Files
ArtPlayer/packages/artplayer/src/control/fullscreenWeb.js
T
2022-02-11 11:20:54 +08:00

26 lines
690 B
JavaScript

import { append, tooltip } from '../utils';
export default function fullscreenWeb(option) {
return (art) => ({
...option,
tooltip: art.i18n.get('Web Fullscreen'),
mounted: ($control) => {
const {
events: { proxy },
icons,
i18n,
} = art;
append($control, icons.fullscreenWeb);
proxy($control, 'click', () => {
art.fullscreenWeb = !art.fullscreenWeb;
});
art.on('fullscreenWeb', (value) => {
tooltip($control, i18n.get(value ? 'Exit Web Fullscreen' : 'Web Fullscreen'));
});
},
});
}