mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-30 12:01:20 -08:00
update artplayer.d.ts
This commit is contained in:
1 parent
6098c7f7ba
commit
6440f5f1cf
5 files changed
+383
-50
No files matched your search
Vendored
+43
-28
@@ -112,6 +112,33 @@ type WhitelistFunction = (ua: string) => Boolean;
|
|||||||
type CustomType = (video: HTMLVideoElement, url: string, art: Artplayer) => any;
|
type CustomType = (video: HTMLVideoElement, url: string, art: Artplayer) => any;
|
||||||
type EventCallback = (event: Event) => any;
|
type EventCallback = (event: Event) => any;
|
||||||
|
|
||||||
|
interface SubtitleOption {
|
||||||
|
/**
|
||||||
|
* The subtitle url
|
||||||
|
*/
|
||||||
|
url: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The subtitle type
|
||||||
|
*/
|
||||||
|
type: 'vtt' | 'srt' | 'ass';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The subtitle style object
|
||||||
|
*/
|
||||||
|
style: CSSStyleDeclaration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The subtitle encoding, default utf-8
|
||||||
|
*/
|
||||||
|
encoding: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether bilingual subtitle
|
||||||
|
*/
|
||||||
|
bilingual: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
interface Option {
|
interface Option {
|
||||||
/**
|
/**
|
||||||
* The container mounted by the player
|
* The container mounted by the player
|
||||||
@@ -366,32 +393,7 @@ interface Option {
|
|||||||
/**
|
/**
|
||||||
* Custom subtitle option
|
* Custom subtitle option
|
||||||
*/
|
*/
|
||||||
subtitle?: {
|
subtitle?: SubtitleOption;
|
||||||
/**
|
|
||||||
* The subtitle url
|
|
||||||
*/
|
|
||||||
url: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The subtitle type
|
|
||||||
*/
|
|
||||||
type: 'vtt' | 'srt' | 'ass';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The subtitle style object
|
|
||||||
*/
|
|
||||||
style: CSSStyleDeclaration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The subtitle encoding
|
|
||||||
*/
|
|
||||||
encoding: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether bilingual subtitle
|
|
||||||
*/
|
|
||||||
bilingual: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Other video attribute
|
* Other video attribute
|
||||||
@@ -402,7 +404,19 @@ interface Option {
|
|||||||
* Custom default icons
|
* Custom default icons
|
||||||
*/
|
*/
|
||||||
icons?: {
|
icons?: {
|
||||||
[propName: string]: string | HTMLElement;
|
loading: HTMLElement | string;
|
||||||
|
state: HTMLElement | string;
|
||||||
|
play: HTMLElement | string;
|
||||||
|
pause: HTMLElement | string;
|
||||||
|
volume: HTMLElement | string;
|
||||||
|
volumeClose: HTMLElement | string;
|
||||||
|
subtitle: HTMLElement | string;
|
||||||
|
screenshot: HTMLElement | string;
|
||||||
|
setting: HTMLElement | string;
|
||||||
|
fullscreen: HTMLElement | string;
|
||||||
|
fullscreenWeb: HTMLElement | string;
|
||||||
|
pip: HTMLElement | string;
|
||||||
|
indicator: HTMLElement | string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -573,6 +587,7 @@ declare class Artplayer extends Player {
|
|||||||
readonly fullscreen: HTMLElement;
|
readonly fullscreen: HTMLElement;
|
||||||
readonly fullscreenWeb: HTMLElement;
|
readonly fullscreenWeb: HTMLElement;
|
||||||
readonly pip: HTMLElement;
|
readonly pip: HTMLElement;
|
||||||
|
readonly indicator: HTMLElement;
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly hotkey: {
|
readonly hotkey: {
|
||||||
@@ -601,7 +616,7 @@ declare class Artplayer extends Player {
|
|||||||
set toggle(state: boolean);
|
set toggle(state: boolean);
|
||||||
get url(): string;
|
get url(): string;
|
||||||
style(name: string | CSSStyleDeclaration, value?: string): HTMLElement;
|
style(name: string | CSSStyleDeclaration, value?: string): HTMLElement;
|
||||||
switch(url: string, option?: object): Promise<string>;
|
switch(url: string, option?: SubtitleOption): Promise<string>;
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly mobile: object;
|
readonly mobile: object;
|
||||||
|
|||||||
@@ -1095,10 +1095,7 @@
|
|||||||
if (typeName && typeCallback) {
|
if (typeName && typeCallback) {
|
||||||
sleep().then(function () {
|
sleep().then(function () {
|
||||||
art.loading.show = true;
|
art.loading.show = true;
|
||||||
var result = typeCallback.call(art, $video, url, art);
|
typeCallback.call(art, $video, url, art);
|
||||||
def(art, typeName, {
|
|
||||||
value: result
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$video.src = url;
|
$video.src = url;
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -16,10 +16,7 @@ export default function urlMix(art, player) {
|
|||||||
if (typeName && typeCallback) {
|
if (typeName && typeCallback) {
|
||||||
sleep().then(() => {
|
sleep().then(() => {
|
||||||
art.loading.show = true;
|
art.loading.show = true;
|
||||||
const result = typeCallback.call(art, $video, url, art);
|
typeCallback.call(art, $video, url, art);
|
||||||
def(art, typeName, {
|
|
||||||
value: result,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$video.src = url;
|
$video.src = url;
|
||||||
|
|||||||
+337
-13
@@ -2,31 +2,108 @@ export = Artplayer;
|
|||||||
export as namespace Artplayer;
|
export as namespace Artplayer;
|
||||||
|
|
||||||
interface Selector {
|
interface Selector {
|
||||||
|
/**
|
||||||
|
* Whether the default is selected
|
||||||
|
*/
|
||||||
default?: boolean;
|
default?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Html string of selector
|
||||||
|
*/
|
||||||
html: string;
|
html: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ComponentOption {
|
interface ComponentOption {
|
||||||
|
/**
|
||||||
|
* Html string or html element of component
|
||||||
|
*/
|
||||||
html: string | HTMLElement;
|
html: string | HTMLElement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to disable component
|
||||||
|
*/
|
||||||
disable?: boolean;
|
disable?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unique name for component
|
||||||
|
*/
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component sort index
|
||||||
|
*/
|
||||||
index?: number;
|
index?: number;
|
||||||
style?: ElementCSSInlineStyle['style'];
|
|
||||||
|
/**
|
||||||
|
* Component style object
|
||||||
|
*/
|
||||||
|
style?: CSSStyleDeclaration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component click event
|
||||||
|
*/
|
||||||
click?(component: Component, event: Event): void;
|
click?(component: Component, event: Event): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wnen the component was mounted
|
||||||
|
*/
|
||||||
mounted?(element: HTMLElement): void;
|
mounted?(element: HTMLElement): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component tooltip, use in controls
|
||||||
|
*/
|
||||||
tooltip?: string;
|
tooltip?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component position, use in controls
|
||||||
|
*/
|
||||||
position?: 'top' | 'left' | 'right';
|
position?: 'top' | 'left' | 'right';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom selector list, use in controls
|
||||||
|
*/
|
||||||
selector?: Selector[];
|
selector?: Selector[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When selector item click, use in controls
|
||||||
|
*/
|
||||||
onSelect?(selector: Selector, element: HTMLElement): void;
|
onSelect?(selector: Selector, element: HTMLElement): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Component {
|
interface Component {
|
||||||
|
/**
|
||||||
|
* Component ID
|
||||||
|
*/
|
||||||
readonly id: number;
|
readonly id: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component name
|
||||||
|
*/
|
||||||
readonly name: string | void;
|
readonly name: string | void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component parent element
|
||||||
|
*/
|
||||||
readonly $parent: HTMLElement | void;
|
readonly $parent: HTMLElement | void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to show component parent
|
||||||
|
*/
|
||||||
get show(): boolean;
|
get show(): boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to show component parent
|
||||||
|
*/
|
||||||
set show(state: boolean);
|
set show(state: boolean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle the component parent
|
||||||
|
*/
|
||||||
set toggle(state: boolean);
|
set toggle(state: boolean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dynamic adding component
|
||||||
|
*/
|
||||||
add(option: ComponentOption): HTMLElement;
|
add(option: ComponentOption): HTMLElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,70 +112,316 @@ type WhitelistFunction = (ua: string) => Boolean;
|
|||||||
type CustomType = (video: HTMLVideoElement, url: string, art: Artplayer) => any;
|
type CustomType = (video: HTMLVideoElement, url: string, art: Artplayer) => any;
|
||||||
type EventCallback = (event: Event) => any;
|
type EventCallback = (event: Event) => any;
|
||||||
|
|
||||||
interface Option {
|
interface SubtitleOption {
|
||||||
container: string | HTMLElement;
|
/**
|
||||||
|
* The subtitle url
|
||||||
|
*/
|
||||||
url: string;
|
url: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The subtitle type
|
||||||
|
*/
|
||||||
|
type: 'vtt' | 'srt' | 'ass';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The subtitle style object
|
||||||
|
*/
|
||||||
|
style: CSSStyleDeclaration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The subtitle encoding, default utf-8
|
||||||
|
*/
|
||||||
|
encoding: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether bilingual subtitle
|
||||||
|
*/
|
||||||
|
bilingual: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Option {
|
||||||
|
/**
|
||||||
|
* The container mounted by the player
|
||||||
|
*/
|
||||||
|
container: string | HTMLElement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Video url
|
||||||
|
*/
|
||||||
|
url: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Video poster image url
|
||||||
|
*/
|
||||||
poster?: string;
|
poster?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Video title
|
||||||
|
*/
|
||||||
title?: string;
|
title?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Video url type
|
||||||
|
*/
|
||||||
type?: string;
|
type?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Player color theme
|
||||||
|
*/
|
||||||
theme?: string;
|
theme?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Player language
|
||||||
|
*/
|
||||||
lang?: 'en' | 'zh-cn' | 'zh-tw';
|
lang?: 'en' | 'zh-cn' | 'zh-tw';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Player default volume
|
||||||
|
*/
|
||||||
volume?: number;
|
volume?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether live broadcast mode
|
||||||
|
*/
|
||||||
isLive?: boolean;
|
isLive?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether video muted
|
||||||
|
*/
|
||||||
muted?: boolean;
|
muted?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether video auto play
|
||||||
|
*/
|
||||||
autoplay?: boolean;
|
autoplay?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether player auto resize
|
||||||
|
*/
|
||||||
autoSize?: boolean;
|
autoSize?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether player auto run mini mode
|
||||||
|
*/
|
||||||
autoMini?: boolean;
|
autoMini?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether video auto loop
|
||||||
|
*/
|
||||||
loop?: boolean;
|
loop?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether show video flip button
|
||||||
|
*/
|
||||||
flip?: boolean;
|
flip?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether show video rotate button
|
||||||
|
*/
|
||||||
rotate?: boolean;
|
rotate?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether show video playback rate button
|
||||||
|
*/
|
||||||
playbackRate?: boolean;
|
playbackRate?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether show video aspect ratio button
|
||||||
|
*/
|
||||||
aspectRatio?: boolean;
|
aspectRatio?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether show video screenshot button
|
||||||
|
*/
|
||||||
screenshot?: boolean;
|
screenshot?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether show video setting button
|
||||||
|
*/
|
||||||
setting?: boolean;
|
setting?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to enable player hotkey
|
||||||
|
*/
|
||||||
hotkey?: boolean;
|
hotkey?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether show video pip button
|
||||||
|
*/
|
||||||
pip?: boolean;
|
pip?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do you want to run only one player at a time
|
||||||
|
*/
|
||||||
mutex?: boolean;
|
mutex?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether use backdrop in UI
|
||||||
|
*/
|
||||||
backdrop?: boolean;
|
backdrop?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether show video window fullscreen button
|
||||||
|
*/
|
||||||
fullscreen?: boolean;
|
fullscreen?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether show video web fullscreen button
|
||||||
|
*/
|
||||||
fullscreenWeb?: boolean;
|
fullscreenWeb?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to enable player subtitle offset
|
||||||
|
*/
|
||||||
subtitleOffset?: boolean;
|
subtitleOffset?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to enable player mini progress bar
|
||||||
|
*/
|
||||||
miniProgressBar?: boolean;
|
miniProgressBar?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether use local video function
|
||||||
|
*/
|
||||||
localVideo?: boolean;
|
localVideo?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether use local subtitle function
|
||||||
|
*/
|
||||||
localSubtitle?: boolean;
|
localSubtitle?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether use SSR function
|
||||||
|
*/
|
||||||
useSSR?: boolean;
|
useSSR?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom plugin list
|
||||||
|
*/
|
||||||
plugins?: PluginFunction[];
|
plugins?: PluginFunction[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom mobile whitelist
|
||||||
|
*/
|
||||||
whitelist?: (string | WhitelistFunction | RegExp)[];
|
whitelist?: (string | WhitelistFunction | RegExp)[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom layer list
|
||||||
|
*/
|
||||||
layers?: ComponentOption[];
|
layers?: ComponentOption[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom contextmenu list
|
||||||
|
*/
|
||||||
contextmenu?: ComponentOption[];
|
contextmenu?: ComponentOption[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom control list
|
||||||
|
*/
|
||||||
controls?: ComponentOption[];
|
controls?: ComponentOption[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom setting list
|
||||||
|
*/
|
||||||
settings?: ComponentOption[];
|
settings?: ComponentOption[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom video quality list
|
||||||
|
*/
|
||||||
quality?: {
|
quality?: {
|
||||||
|
/**
|
||||||
|
* Whether the default is selected
|
||||||
|
*/
|
||||||
default?: boolean;
|
default?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Html string of quality
|
||||||
|
*/
|
||||||
html: string;
|
html: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Video quality url
|
||||||
|
*/
|
||||||
url: string;
|
url: string;
|
||||||
}[];
|
}[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom highlight list
|
||||||
|
*/
|
||||||
highlight?: {
|
highlight?: {
|
||||||
|
/**
|
||||||
|
* The highlight time
|
||||||
|
*/
|
||||||
time: number;
|
time: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The highlight text
|
||||||
|
*/
|
||||||
text: string;
|
text: string;
|
||||||
}[];
|
}[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom thumbnail
|
||||||
|
*/
|
||||||
thumbnails?: {
|
thumbnails?: {
|
||||||
|
/**
|
||||||
|
* The thumbnail image url
|
||||||
|
*/
|
||||||
url: string;
|
url: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The thumbnail item number
|
||||||
|
*/
|
||||||
number?: number;
|
number?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The thumbnail item width
|
||||||
|
*/
|
||||||
width?: number;
|
width?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The thumbnail item height
|
||||||
|
*/
|
||||||
height?: number;
|
height?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The thumbnail column size
|
||||||
|
*/
|
||||||
column?: number;
|
column?: number;
|
||||||
};
|
};
|
||||||
subtitle?: {
|
|
||||||
url: string;
|
/**
|
||||||
style: ElementCSSInlineStyle['style'];
|
* Custom subtitle option
|
||||||
encoding: string;
|
*/
|
||||||
bilingual: boolean;
|
subtitle?: SubtitleOption;
|
||||||
};
|
|
||||||
moreVideoAttr?: object;
|
/**
|
||||||
|
* Other video attribute
|
||||||
|
*/
|
||||||
|
moreVideoAttr?: HTMLVideoElement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom default icons
|
||||||
|
*/
|
||||||
icons?: {
|
icons?: {
|
||||||
[propName: string]: string | HTMLElement;
|
loading: HTMLElement | string;
|
||||||
|
state: HTMLElement | string;
|
||||||
|
play: HTMLElement | string;
|
||||||
|
pause: HTMLElement | string;
|
||||||
|
volume: HTMLElement | string;
|
||||||
|
volumeClose: HTMLElement | string;
|
||||||
|
subtitle: HTMLElement | string;
|
||||||
|
screenshot: HTMLElement | string;
|
||||||
|
setting: HTMLElement | string;
|
||||||
|
fullscreen: HTMLElement | string;
|
||||||
|
fullscreenWeb: HTMLElement | string;
|
||||||
|
pip: HTMLElement | string;
|
||||||
|
indicator: HTMLElement | string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom video type function
|
||||||
|
*/
|
||||||
customType?: {
|
customType?: {
|
||||||
[propName: string]: CustomType;
|
[propName: string]: CustomType;
|
||||||
};
|
};
|
||||||
@@ -264,6 +587,7 @@ declare class Artplayer extends Player {
|
|||||||
readonly fullscreen: HTMLElement;
|
readonly fullscreen: HTMLElement;
|
||||||
readonly fullscreenWeb: HTMLElement;
|
readonly fullscreenWeb: HTMLElement;
|
||||||
readonly pip: HTMLElement;
|
readonly pip: HTMLElement;
|
||||||
|
readonly indicator: HTMLElement;
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly hotkey: {
|
readonly hotkey: {
|
||||||
@@ -291,8 +615,8 @@ declare class Artplayer extends Player {
|
|||||||
set show(state: boolean);
|
set show(state: boolean);
|
||||||
set toggle(state: boolean);
|
set toggle(state: boolean);
|
||||||
get url(): string;
|
get url(): string;
|
||||||
style(name: string | ElementCSSInlineStyle['style'], value?: string): HTMLElement;
|
style(name: string | CSSStyleDeclaration, value?: string): HTMLElement;
|
||||||
switch(url: string, option?: object): Promise<string>;
|
switch(url: string, option?: SubtitleOption): Promise<string>;
|
||||||
};
|
};
|
||||||
|
|
||||||
readonly mobile: object;
|
readonly mobile: object;
|
||||||
|
|||||||
Reference in new issue
Block a user