mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 22:01:20 -08:00
add Artplayer.SEEK_STEP
This commit is contained in:
1 parent
2ba636f3c7
commit
92ad45b976
25 files changed
+274
-309
No files matched your search
@@ -22,8 +22,8 @@ export default class Contextmenu extends Component {
|
||||
init() {
|
||||
const {
|
||||
option,
|
||||
proxy,
|
||||
template: { $player, $contextmenu },
|
||||
events: { proxy },
|
||||
} = this.art;
|
||||
|
||||
if (option.playbackRate) {
|
||||
|
||||
@@ -5,11 +5,7 @@ export default function pip(option) {
|
||||
...option,
|
||||
tooltip: art.i18n.get('AirPlay'),
|
||||
mounted: ($control) => {
|
||||
const {
|
||||
events: { proxy },
|
||||
icons,
|
||||
} = art;
|
||||
|
||||
const { proxy, icons } = art;
|
||||
append($control, icons.airplay);
|
||||
proxy($control, 'click', () => art.airplay());
|
||||
},
|
||||
|
||||
@@ -5,11 +5,7 @@ export default function fullscreen(option) {
|
||||
...option,
|
||||
tooltip: art.i18n.get('Fullscreen'),
|
||||
mounted: ($control) => {
|
||||
const {
|
||||
events: { proxy },
|
||||
icons,
|
||||
i18n,
|
||||
} = art;
|
||||
const { proxy, icons, i18n } = art;
|
||||
|
||||
const $fullscreenOn = append($control, icons.fullscreenOn);
|
||||
const $fullscreenOff = append($control, icons.fullscreenOff);
|
||||
|
||||
@@ -5,11 +5,7 @@ export default function fullscreenWeb(option) {
|
||||
...option,
|
||||
tooltip: art.i18n.get('Web Fullscreen'),
|
||||
mounted: ($control) => {
|
||||
const {
|
||||
events: { proxy },
|
||||
icons,
|
||||
i18n,
|
||||
} = art;
|
||||
const { proxy, icons, i18n } = art;
|
||||
|
||||
const $fullscreenWebOn = append($control, icons.fullscreenWebOn);
|
||||
const $fullscreenWebOff = append($control, icons.fullscreenWebOff);
|
||||
|
||||
@@ -21,8 +21,8 @@ export default class Control extends Component {
|
||||
this.name = 'control';
|
||||
|
||||
const {
|
||||
proxy,
|
||||
constructor,
|
||||
events: { proxy },
|
||||
template: { $player },
|
||||
} = art;
|
||||
|
||||
|
||||
@@ -5,11 +5,7 @@ export default function pip(option) {
|
||||
...option,
|
||||
tooltip: art.i18n.get('PIP Mode'),
|
||||
mounted: ($control) => {
|
||||
const {
|
||||
events: { proxy },
|
||||
icons,
|
||||
i18n,
|
||||
} = art;
|
||||
const { proxy, icons, i18n } = art;
|
||||
|
||||
append($control, icons.pip);
|
||||
|
||||
|
||||
@@ -4,11 +4,7 @@ export default function playAndPause(option) {
|
||||
return (art) => ({
|
||||
...option,
|
||||
mounted: ($control) => {
|
||||
const {
|
||||
events: { proxy },
|
||||
icons,
|
||||
i18n,
|
||||
} = art;
|
||||
const { proxy, icons, i18n } = art;
|
||||
|
||||
const $play = append($control, icons.play);
|
||||
const $pause = append($control, icons.pause);
|
||||
|
||||
@@ -13,11 +13,7 @@ export function getPosFromEvent(art, event) {
|
||||
|
||||
export default function progress(options) {
|
||||
return (art) => {
|
||||
const {
|
||||
icons,
|
||||
option,
|
||||
events: { proxy },
|
||||
} = art;
|
||||
const { icons, option, proxy } = art;
|
||||
|
||||
return {
|
||||
...options,
|
||||
|
||||
@@ -5,10 +5,7 @@ export default function screenshot(option) {
|
||||
...option,
|
||||
tooltip: art.i18n.get('Screenshot'),
|
||||
mounted: ($control) => {
|
||||
const {
|
||||
events: { proxy },
|
||||
icons,
|
||||
} = art;
|
||||
const { proxy, icons } = art;
|
||||
|
||||
append($control, icons.screenshot);
|
||||
proxy($control, 'click', () => {
|
||||
|
||||
@@ -5,11 +5,7 @@ export default function setting(option) {
|
||||
...option,
|
||||
tooltip: art.i18n.get('Show Setting'),
|
||||
mounted: ($control) => {
|
||||
const {
|
||||
events: { proxy },
|
||||
icons,
|
||||
i18n,
|
||||
} = art;
|
||||
const { proxy, icons, i18n } = art;
|
||||
|
||||
append($control, icons.setting);
|
||||
|
||||
|
||||
@@ -4,11 +4,7 @@ export default function volume(option) {
|
||||
return (art) => ({
|
||||
...option,
|
||||
mounted: ($control) => {
|
||||
const {
|
||||
events: { proxy },
|
||||
icons,
|
||||
i18n,
|
||||
} = art;
|
||||
const { proxy, icons, i18n } = art;
|
||||
|
||||
let isDroging = false;
|
||||
const panelWidth = art.constructor.VOLUME_PANEL_WIDTH;
|
||||
|
||||
@@ -11,7 +11,7 @@ export default class Hotkey {
|
||||
}
|
||||
|
||||
init() {
|
||||
const { proxy } = this.art.events;
|
||||
const { proxy, constructor } = this.art;
|
||||
|
||||
this.add(27, () => {
|
||||
if (this.art.fullscreenWeb) {
|
||||
@@ -24,19 +24,19 @@ export default class Hotkey {
|
||||
});
|
||||
|
||||
this.add(37, () => {
|
||||
this.art.backward = 5;
|
||||
this.art.backward = constructor.SEEK_STEP;
|
||||
});
|
||||
|
||||
this.add(38, () => {
|
||||
this.art.volume += 0.1;
|
||||
this.art.volume += constructor.VOLUME_STEP;
|
||||
});
|
||||
|
||||
this.add(39, () => {
|
||||
this.art.forward = 5;
|
||||
this.art.forward = constructor.SEEK_STEP;
|
||||
});
|
||||
|
||||
this.add(40, () => {
|
||||
this.art.volume -= 0.1;
|
||||
this.art.volume -= constructor.VOLUME_STEP;
|
||||
});
|
||||
|
||||
proxy(window, 'keydown', (event) => {
|
||||
|
||||
@@ -227,6 +227,8 @@ Artplayer.INFO_LOOP_TIME = 1000;
|
||||
Artplayer.FAST_FORWARD_VALUE = 3;
|
||||
Artplayer.FAST_FORWARD_TIME = 1000;
|
||||
Artplayer.TOUCH_MOVE_RATIO = 0.5;
|
||||
Artplayer.VOLUME_STEP = 0.1;
|
||||
Artplayer.SEEK_STEP = 5;
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
if (!document.getElementById('artplayer-style')) {
|
||||
|
||||
@@ -5,7 +5,7 @@ export default class Info extends Component {
|
||||
constructor(art) {
|
||||
super(art);
|
||||
this.name = 'info';
|
||||
|
||||
|
||||
if (!isMobile) {
|
||||
this.init();
|
||||
}
|
||||
@@ -13,8 +13,8 @@ export default class Info extends Component {
|
||||
|
||||
init() {
|
||||
const {
|
||||
proxy,
|
||||
constructor,
|
||||
events: { proxy },
|
||||
template: { $infoPanel, $infoClose, $video },
|
||||
} = this.art;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ export default class Mobile {
|
||||
constructor(art) {
|
||||
const {
|
||||
option,
|
||||
events: { proxy },
|
||||
proxy,
|
||||
template: { $video },
|
||||
} = art;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ export default function airplayMix(art) {
|
||||
const {
|
||||
i18n,
|
||||
notice,
|
||||
events: { proxy },
|
||||
proxy,
|
||||
template: { $video },
|
||||
} = art;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ export default function eventInit(art) {
|
||||
notice,
|
||||
option,
|
||||
constructor,
|
||||
events: { proxy },
|
||||
proxy,
|
||||
template: { $player, $video, $poster },
|
||||
} = art;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ export default function miniMix(art) {
|
||||
i18n,
|
||||
option,
|
||||
storage,
|
||||
events: { proxy },
|
||||
proxy,
|
||||
template: { $player, $miniClose, $miniTitle, $miniHeader },
|
||||
} = art;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { def } from '../utils';
|
||||
function nativePip(art) {
|
||||
const {
|
||||
template: { $video },
|
||||
events: { proxy },
|
||||
proxy,
|
||||
notice,
|
||||
} = art;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ export default function autoPlayback(art) {
|
||||
icons,
|
||||
storage,
|
||||
constructor,
|
||||
events: { proxy },
|
||||
proxy,
|
||||
template: { $poster },
|
||||
} = art;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { hasClass, addClass, removeClass } from '../utils';
|
||||
export default function fastForward(art) {
|
||||
const {
|
||||
constructor,
|
||||
events: { proxy },
|
||||
proxy,
|
||||
template: { $player, $video },
|
||||
} = art;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ export default class Setting extends Component {
|
||||
|
||||
const {
|
||||
option,
|
||||
events: { proxy },
|
||||
proxy,
|
||||
template: { $setting, $player },
|
||||
} = art;
|
||||
|
||||
@@ -99,10 +99,7 @@ export default class Setting extends Component {
|
||||
}
|
||||
|
||||
creatHeader(item) {
|
||||
const {
|
||||
icons,
|
||||
events: { proxy },
|
||||
} = this.art;
|
||||
const { icons, proxy } = this.art;
|
||||
|
||||
const $item = createElement('div');
|
||||
addClass($item, 'art-setting-item');
|
||||
@@ -124,10 +121,7 @@ export default class Setting extends Component {
|
||||
}
|
||||
|
||||
creatItem(type, item) {
|
||||
const {
|
||||
icons,
|
||||
events: { proxy },
|
||||
} = this.art;
|
||||
const { icons, proxy } = this.art;
|
||||
|
||||
const $item = createElement('div');
|
||||
addClass($item, 'art-setting-item');
|
||||
|
||||
Reference in new issue
Block a user