update ts

This commit is contained in:
Harvey committed 2021-12-01 14:16:43 +08:00
1 parent 7dfe78a95d
commit 69563e818b
10 files changed
+352 -119

No files matched your search

+31 -23
View File
@@ -1266,7 +1266,7 @@
} }
function exclusiveInit(art, player) { function exclusiveInit(art, player) {
var sizeProps = ['mini', 'pip', 'fullscreen', 'fullscreenWeb', 'fullscreenRotate']; var sizeProps = ['mini', 'pip', 'fullscreen', 'fullscreenWeb'];
function exclusive(props) { function exclusive(props) {
props.forEach(function (name) { props.forEach(function (name) {
@@ -1344,9 +1344,9 @@
def(player, 'toggle', { def(player, 'toggle', {
value: function value() { value: function value() {
if (player.playing) { if (player.playing) {
player.pause(); return player.pause();
} else { } else {
player.play(); return player.play();
} }
} }
}); });
@@ -1436,27 +1436,31 @@
notice = art.notice; notice = art.notice;
function switchUrl(url, name, currentTime) { function switchUrl(url, name, currentTime) {
if (url === player.url) return; return new Promise(function (resolve) {
URL.revokeObjectURL(player.url); if (url === player.url) return resolve(url);
var playing = player.playing; URL.revokeObjectURL(player.url);
player.url = url; var playing = player.playing;
art.once('video:canplay', function () { player.url = url;
player.playbackRate = false; art.once('video:canplay', function () {
player.aspectRatio = false; player.playbackRate = false;
player.flip = 'normal'; player.aspectRatio = false;
player.autoSize = option.autoSize; player.flip = 'normal';
player.currentTime = currentTime; player.autoSize = option.autoSize;
art.notice.show = ''; player.currentTime = currentTime;
art.notice.show = '';
if (playing) { if (playing) {
player.play(); player.play();
} }
if (name) { if (name) {
notice.show = "".concat(i18n.get('Switch video'), ": ").concat(name); notice.show = "".concat(i18n.get('Switch video'), ": ").concat(name);
} }
art.emit('switch', url);
resolve(url);
});
}); });
art.emit('switch', url);
} }
def(player, 'switchQuality', { def(player, 'switchQuality', {
@@ -1608,9 +1612,10 @@
}); });
def(player, 'screenshot', { def(player, 'screenshot', {
value: function value() { value: function value() {
player.getDataURL().then(function (dataUri) { return player.getDataURL().then(function (dataUri) {
download(dataUri, "".concat(option.title || 'artplayer', "_").concat(secondToTime($video.currentTime), ".png")); download(dataUri, "".concat(option.title || 'artplayer', "_").concat(secondToTime($video.currentTime), ".png"));
art.emit('screenshot', dataUri); art.emit('screenshot', dataUri);
return dataUri;
}); });
} }
}); });
@@ -2517,6 +2522,7 @@
def(this, name, { def(this, name, {
value: $ref value: $ref
}); });
return $ref;
} }
}, { }, {
key: "selector", key: "selector",
@@ -4013,6 +4019,8 @@
} else { } else {
this.keys[key] = [event]; this.keys[key] = [event];
} }
return this;
} }
}]); }]);
@@ -4838,7 +4846,7 @@
}, { }, {
key: "build", key: "build",
get: function get() { get: function get() {
return '1638325351386'; return '1638339306854';
} }
}, { }, {
key: "config", key: "config",
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"artplayer.js","sources":["../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/classCallCheck.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/createClass.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/assertThisInitialized.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/setPrototypeOf.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/inherits.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/typeof.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/possibleConstructorReturn.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/getPrototypeOf.js","../../node_modules/_style-inject@0.3.0@style-inject/dist/style-inject.es.js","../../packages/artplayer/node_modules/_option-validator@2.0.6@option-validator/dist/option-validator.js","../../packages/artplayer/src/utils/emitter.js","../../packages/artplayer/src/utils/compatibility.js","../../packages/artplayer/src/utils/dom.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/isNativeFunction.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/construct.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/wrapNativeSuper.js","../../packages/artplayer/src/utils/error.js","../../packages/artplayer/src/utils/subtitle.js","../../packages/artplayer/src/utils/file.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/iterableToArray.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/nonIterableSpread.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/toConsumableArray.js","../../packages/artplayer/src/utils/property.js","../../packages/artplayer/src/utils/time.js","../../packages/artplayer/src/utils/format.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/defineProperty.js","../../packages/artplayer/src/scheme/index.js","../../packages/artplayer/src/config/index.js","../../packages/artplayer/src/whitelist.js","../../packages/artplayer/src/template.js","../../packages/artplayer/src/i18n/index.js","../../packages/artplayer/src/player/urlMix.js","../../packages/artplayer/src/player/attrInit.js","../../packages/artplayer/src/player/eventInit.js","../../packages/artplayer/src/player/exclusiveInit.js","../../packages/artplayer/src/player/playMix.js","../../packages/artplayer/src/player/pauseMix.js","../../packages/artplayer/src/player/toggleMix.js","../../packages/artplayer/src/player/seekMix.js","../../packages/artplayer/src/player/volumeMix.js","../../packages/artplayer/src/player/currentTimeMix.js","../../packages/artplayer/src/player/durationMix.js","../../packages/artplayer/src/player/switchMix.js","../../packages/artplayer/src/player/playbackRateMix.js","../../packages/artplayer/src/player/aspectRatioMix.js","../../packages/artplayer/src/player/screenshotMix.js","../../packages/artplayer/node_modules/screenfull/dist/screenfull.js","../../packages/artplayer/src/player/fullscreenMix.js","../../packages/artplayer/src/player/fullscreenWebMix.js","../../packages/artplayer/src/player/pipMix.js","../../packages/artplayer/src/player/loadedMix.js","../../packages/artplayer/src/player/playedMix.js","../../packages/artplayer/src/player/playingMix.js","../../packages/artplayer/src/player/autoSizeMix.js","../../packages/artplayer/src/player/rectMix.js","../../packages/artplayer/src/player/flipMix.js","../../packages/artplayer/src/player/miniMix.js","../../packages/artplayer/src/player/loopMin.js","../../packages/artplayer/src/player/rotateMix.js","../../packages/artplayer/src/player/posterMix.js","../../packages/artplayer/src/player/index.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/superPropBase.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/get.js","../../packages/artplayer/src/utils/component.js","../../packages/artplayer/src/control/fullscreen.js","../../packages/artplayer/src/control/fullscreenWeb.js","../../packages/artplayer/src/control/pip.js","../../packages/artplayer/src/control/playAndPause.js","../../packages/artplayer/src/control/progress.js","../../packages/artplayer/src/control/subtitle.js","../../packages/artplayer/src/control/time.js","../../packages/artplayer/src/control/volume.js","../../packages/artplayer/src/control/setting.js","../../packages/artplayer/src/control/thumbnails.js","../../packages/artplayer/src/control/screenshot.js","../../packages/artplayer/src/control/quality.jLine truncated {"version":3,"file":"artplayer.js","sources":["../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/classCallCheck.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/createClass.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/assertThisInitialized.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/setPrototypeOf.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/inherits.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/typeof.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/possibleConstructorReturn.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/getPrototypeOf.js","../../node_modules/_style-inject@0.3.0@style-inject/dist/style-inject.es.js","../../packages/artplayer/node_modules/_option-validator@2.0.6@option-validator/dist/option-validator.js","../../packages/artplayer/src/utils/emitter.js","../../packages/artplayer/src/utils/compatibility.js","../../packages/artplayer/src/utils/dom.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/isNativeFunction.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/construct.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/wrapNativeSuper.js","../../packages/artplayer/src/utils/error.js","../../packages/artplayer/src/utils/subtitle.js","../../packages/artplayer/src/utils/file.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/iterableToArray.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/nonIterableSpread.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/toConsumableArray.js","../../packages/artplayer/src/utils/property.js","../../packages/artplayer/src/utils/time.js","../../packages/artplayer/src/utils/format.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/defineProperty.js","../../packages/artplayer/src/scheme/index.js","../../packages/artplayer/src/config/index.js","../../packages/artplayer/src/whitelist.js","../../packages/artplayer/src/template.js","../../packages/artplayer/src/i18n/index.js","../../packages/artplayer/src/player/urlMix.js","../../packages/artplayer/src/player/attrInit.js","../../packages/artplayer/src/player/eventInit.js","../../packages/artplayer/src/player/exclusiveInit.js","../../packages/artplayer/src/player/playMix.js","../../packages/artplayer/src/player/pauseMix.js","../../packages/artplayer/src/player/toggleMix.js","../../packages/artplayer/src/player/seekMix.js","../../packages/artplayer/src/player/volumeMix.js","../../packages/artplayer/src/player/currentTimeMix.js","../../packages/artplayer/src/player/durationMix.js","../../packages/artplayer/src/player/switchMix.js","../../packages/artplayer/src/player/playbackRateMix.js","../../packages/artplayer/src/player/aspectRatioMix.js","../../packages/artplayer/src/player/screenshotMix.js","../../packages/artplayer/node_modules/screenfull/dist/screenfull.js","../../packages/artplayer/src/player/fullscreenMix.js","../../packages/artplayer/src/player/fullscreenWebMix.js","../../packages/artplayer/src/player/pipMix.js","../../packages/artplayer/src/player/loadedMix.js","../../packages/artplayer/src/player/playedMix.js","../../packages/artplayer/src/player/playingMix.js","../../packages/artplayer/src/player/autoSizeMix.js","../../packages/artplayer/src/player/rectMix.js","../../packages/artplayer/src/player/flipMix.js","../../packages/artplayer/src/player/miniMix.js","../../packages/artplayer/src/player/loopMin.js","../../packages/artplayer/src/player/rotateMix.js","../../packages/artplayer/src/player/posterMix.js","../../packages/artplayer/src/player/index.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/superPropBase.js","../../node_modules/_@babel_runtime@7.16.3@@babel/runtime/helpers/esm/get.js","../../packages/artplayer/src/utils/component.js","../../packages/artplayer/src/control/fullscreen.js","../../packages/artplayer/src/control/fullscreenWeb.js","../../packages/artplayer/src/control/pip.js","../../packages/artplayer/src/control/playAndPause.js","../../packages/artplayer/src/control/progress.js","../../packages/artplayer/src/control/subtitle.js","../../packages/artplayer/src/control/time.js","../../packages/artplayer/src/control/volume.js","../../packages/artplayer/src/control/setting.js","../../packages/artplayer/src/control/thumbnails.js","../../packages/artplayer/src/control/screenshot.js","../../packages/artplayer/src/control/quality.jLine truncated
+1
View File
@@ -60,5 +60,6 @@ export default class Hotkey {
} else { } else {
this.keys[key] = [event]; this.keys[key] = [event];
} }
return this;
} }
} }
@@ -1,7 +1,7 @@
import { def } from '../utils'; import { def } from '../utils';
export default function exclusiveInit(art, player) { export default function exclusiveInit(art, player) {
const sizeProps = ['mini', 'pip', 'fullscreen', 'fullscreenWeb', 'fullscreenRotate']; const sizeProps = ['mini', 'pip', 'fullscreen', 'fullscreenWeb'];
function exclusive(props) { function exclusive(props) {
props.forEach((name) => { props.forEach((name) => {
@@ -43,9 +43,10 @@ export default function screenshotMix(art, player) {
def(player, 'screenshot', { def(player, 'screenshot', {
value: () => { value: () => {
player.getDataURL().then((dataUri) => { return player.getDataURL().then((dataUri) => {
download(dataUri, `${option.title || 'artplayer'}_${secondToTime($video.currentTime)}.png`); download(dataUri, `${option.title || 'artplayer'}_${secondToTime($video.currentTime)}.png`);
art.emit('screenshot', dataUri); art.emit('screenshot', dataUri);
return dataUri;
}); });
}, },
}); });
+21 -18
View File
@@ -4,25 +4,28 @@ export default function switchMix(art, player) {
const { i18n, option, notice } = art; const { i18n, option, notice } = art;
function switchUrl(url, name, currentTime) { function switchUrl(url, name, currentTime) {
if (url === player.url) return; return new Promise((resolve) => {
URL.revokeObjectURL(player.url); if (url === player.url) return resolve(url);
const { playing } = player; URL.revokeObjectURL(player.url);
player.url = url; const { playing } = player;
art.once('video:canplay', () => { player.url = url;
player.playbackRate = false; art.once('video:canplay', () => {
player.aspectRatio = false; player.playbackRate = false;
player.flip = 'normal'; player.aspectRatio = false;
player.autoSize = option.autoSize; player.flip = 'normal';
player.currentTime = currentTime; player.autoSize = option.autoSize;
art.notice.show = ''; player.currentTime = currentTime;
if (playing) { art.notice.show = '';
player.play(); if (playing) {
} player.play();
if (name) { }
notice.show = `${i18n.get('Switch video')}: ${name}`; if (name) {
} notice.show = `${i18n.get('Switch video')}: ${name}`;
}
art.emit('switch', url);
resolve(url);
});
}); });
art.emit('switch', url);
} }
def(player, 'switchQuality', { def(player, 'switchQuality', {
+2 -2
View File
@@ -4,9 +4,9 @@ export default function toggleMix(art, player) {
def(player, 'toggle', { def(player, 'toggle', {
value() { value() {
if (player.playing) { if (player.playing) {
player.pause(); return player.pause();
} else { } else {
player.play(); return player.play();
} }
}, },
}); });
@@ -84,6 +84,8 @@ export default class Component {
def(this, name, { def(this, name, {
value: $ref, value: $ref,
}); });
return $ref;
} }
selector(option, $ref) { selector(option, $ref) {
+291 -72
View File
@@ -1,4 +1,6 @@
type Component = { export = Artplayer;
interface ComponentOption {
html: string | HTMLElement; html: string | HTMLElement;
disable?: boolean; disable?: boolean;
name?: string; name?: string;
@@ -13,75 +15,292 @@ type Component = {
html: string; html: string;
}[]; }[];
onSelect?: Function; onSelect?: Function;
}; }
export default class Artplayer { interface Component {
constructor(option: { readonly id: number;
container: string | HTMLElement; readonly name: string | void;
url: string; readonly $parent: HTMLElement | void;
poster?: string; get show(): boolean;
title?: string; set show(state: boolean);
type?: string; set toggle(state: boolean);
theme?: string; add(option: ComponentOption): HTMLElement;
lang?: 'en' | 'zh-cn' | 'zh-tw'; }
volume?: number;
isLive?: boolean; interface Option {
muted?: boolean; container: string | HTMLElement;
autoplay?: boolean; url: string;
autoSize?: boolean; poster?: string;
autoMini?: boolean; title?: string;
loop?: boolean; type?: string;
flip?: boolean; theme?: string;
rotate?: boolean; lang?: 'en' | 'zh-cn' | 'zh-tw';
playbackRate?: boolean; volume?: number;
aspectRatio?: boolean; isLive?: boolean;
screenshot?: boolean; muted?: boolean;
setting?: boolean; autoplay?: boolean;
hotkey?: boolean; autoSize?: boolean;
pip?: boolean; autoMini?: boolean;
mutex?: boolean; loop?: boolean;
backdrop?: boolean; flip?: boolean;
fullscreen?: boolean; rotate?: boolean;
fullscreenWeb?: boolean; playbackRate?: boolean;
subtitleOffset?: boolean; aspectRatio?: boolean;
miniProgressBar?: boolean; screenshot?: boolean;
localVideo?: boolean; setting?: boolean;
localSubtitle?: boolean; hotkey?: boolean;
useSSR?: boolean; pip?: boolean;
plugins?: Function[]; mutex?: boolean;
whitelist?: (string | Function | RegExp)[]; backdrop?: boolean;
layers?: Component[]; fullscreen?: boolean;
contextmenu?: Component[]; fullscreenWeb?: boolean;
controls?: Component[]; subtitleOffset?: boolean;
settings?: Component[]; miniProgressBar?: boolean;
quality?: { localVideo?: boolean;
default?: boolean; localSubtitle?: boolean;
html: string; useSSR?: boolean;
url: string; plugins?: Function[];
}[]; whitelist?: (string | Function | RegExp)[];
highlight?: { layers?: ComponentOption[];
time: number; contextmenu?: ComponentOption[];
text: string; controls?: ComponentOption[];
}[]; settings?: ComponentOption[];
thumbnails?: { quality?: {
url: string; default?: boolean;
number?: number; html: string;
width?: number; url: string;
height?: number; }[];
column?: number; highlight?: {
}; time: number;
subtitle?: { text: string;
url: string; }[];
style: object; thumbnails?: {
encoding: string; url: string;
bilingual: boolean; number?: number;
}; width?: number;
moreVideoAttr?: object; height?: number;
icons?: { column?: number;
[propName: string]: string | HTMLElement; };
}; subtitle?: {
customType?: { url: string;
[propName: string]: Function; style: object;
}; encoding: string;
}); bilingual: boolean;
};
moreVideoAttr?: object;
icons?: {
[propName: string]: string | HTMLElement;
};
customType?: {
[propName: string]: Function;
};
}
type AspectRatio = 'default' | '4:3' | '16:9' | void;
type PlaybackRate = 0.5 | 0.75 | 1.0 | 1.25 | 1.5 | 1.75 | 2.0 | void;
type Rotate = -270 | -180 | -90 | 0 | 90 | 180 | 270 | void;
type Flip = 'normal' | 'horizontal' | 'vertical' | void;
declare class Player {
get aspectRatio(): AspectRatio;
set aspectRatio(ratio: AspectRatio);
get playbackRate(): PlaybackRate;
set playbackRate(rate: PlaybackRate);
get rotate(): Rotate;
set rotate(deg: Rotate);
get autoSize(): boolean;
set autoSize(state: boolean);
get currentTime(): number;
set currentTime(time: number);
get duration(): number;
get played(): number;
get playing(): boolean;
get flip(): Flip;
set flip(state: Flip);
get fullscreen(): boolean;
set fullscreen(state: boolean);
set fullscreenToggle(state: boolean);
get fullscreenWeb(): boolean;
set fullscreenWeb(state: boolean);
set fullscreenWebToggle(state: boolean);
get loaded(): number;
get loop(): number[];
set loop(value: number[]);
get mini(): boolean;
set mini(state: boolean);
get pip(): boolean;
set pip(state: boolean);
get poster(): string;
set poster(url: string);
get rect(): DOMRect;
get bottom(): number;
get height(): number;
get left(): number;
get right(): number;
get top(): number;
get width(): number;
get x(): number;
get y(): number;
set seek(time: number);
set forward(time: number);
set backward(time: number);
get url(): string;
set url(url: string);
get volume(): number;
set volume(percentage: number);
get muted(): boolean;
set muted(state: boolean);
pause(): any;
play(): any;
toggle(): any;
switchUrl(): Promise<string>;
switchQuality(): Promise<string>;
getDataURL(): Promise<string>;
getBlobUrl(): Promise<string>;
screenshot(): Promise<string>;
}
declare class Artplayer extends Player {
constructor(option: Option);
static instances: Artplayer[];
static version: string;
static env: string;
static build: string;
static config: object;
static utils: object;
static scheme: object;
static Emitter: Function;
static validator: Function;
static kindOf: Function;
static html: string;
static option: Option;
readonly id: number;
readonly option: Option;
readonly isFocus: boolean;
readonly isDestroy: boolean;
readonly userAgent: string;
readonly isMobile: boolean;
readonly isWechat: boolean;
on(name: string, fn: Function, ctx?: object): void;
once(name: string, fn: Function, ctx?: object): void;
emit(name: string): void;
off(name: string, callback?: Function): void;
query(selector: string): HTMLElement;
destroy(removeHtml?: boolean): void;
readonly template: {
query(str: string): HTMLElement;
readonly $container: HTMLElement;
readonly $original: HTMLElement;
readonly $player: HTMLElement;
readonly $video: HTMLElement;
readonly $poster: HTMLElement;
readonly $subtitle: HTMLElement;
readonly $danmuku: HTMLElement;
readonly $bottom: HTMLElement;
readonly $progress: HTMLElement;
readonly $controls: HTMLElement;
readonly $controlsLeft: HTMLElement;
readonly $controlsRight: HTMLElement;
readonly $layer: HTMLElement;
readonly $loading: HTMLElement;
readonly $notice: HTMLElement;
readonly $noticeInner: HTMLElement;
readonly $mask: HTMLElement;
readonly $state: HTMLElement;
readonly $setting: HTMLElement;
readonly $settingInner: HTMLElement;
readonly $settingBody: HTMLElement;
readonly $info: HTMLElement;
readonly $infoPanel: HTMLElement;
readonly $infoClose: HTMLElement;
readonly $miniHeader: HTMLElement;
readonly $miniTitle: HTMLElement;
readonly $miniClose: HTMLElement;
readonly $contextmenu: HTMLElement;
};
readonly events: {
proxy(target: HTMLElement, name: string, callback: Function, option?: object): Function;
hover(target: HTMLElement, mouseenter?: Function, mouseleave?: Function): Function;
loadImg(target: HTMLImageElement | string): Promise<HTMLImageElement>;
};
readonly whitelist: {
readonly state: boolean;
};
readonly storage: {
readonly name: string;
readonly settings: object;
get(key: string): any;
set(key: string, value: any): void;
del(key: string): any;
clean(): any;
};
readonly icons: {
readonly loading: HTMLElement;
readonly state: HTMLElement;
readonly play: HTMLElement;
readonly pause: HTMLElement;
readonly volume: HTMLElement;
readonly volumeClose: HTMLElement;
readonly subtitle: HTMLElement;
readonly screenshot: HTMLElement;
readonly setting: HTMLElement;
readonly fullscreen: HTMLElement;
readonly fullscreenWeb: HTMLElement;
readonly pip: HTMLElement;
};
readonly hotkey: {
add(key: number, event: Function): Artplayer['hotkey'];
};
readonly plugins: {
readonly id: number;
add(plugin: Function): Artplayer['plugins'];
};
readonly i18n: {
readonly languages: object;
get(key: string): string;
update(language: object): void;
};
readonly notice: {
time: number;
set show(msg: string);
};
readonly subtitle: {
get show(): boolean;
set show(state: boolean);
set toggle(state: boolean);
get url(): string;
style(name: string | object, value?: string): HTMLElement;
switch(url: string, option?: object): Promise<string>;
};
readonly mobile: object;
readonly player: Player;
readonly layers: Component;
readonly controls: Component;
readonly contextmenu: Component;
readonly info: Component;
readonly loading: Component;
readonly mask: Component;
readonly setting: Component;
} }
-1
View File
@@ -19,7 +19,6 @@
padding: 10px; padding: 10px;
border-right: 1px solid #999; border-right: 1px solid #999;
} }
</style> </style>
</head> </head>