feat: add danmuku plugin documentation and i18n setup guide

- Created a new documentation file for the danmuku plugin with code examples.
- Added a comprehensive guide for language settings (i18n) including default languages, importing languages, adding new languages, and modifying existing languages.
- Included code snippets for initializing the Artplayer with different language configurations.
This commit is contained in:
Harvey Zhao committed 2026-02-12 16:55:43 +08:00
1 parent 687a34c6b3
commit cfaaea6a5c
72 files changed
+436 -392

No files matched your search

+11 -86
View File
@@ -1,95 +1,20 @@
interface Option {
/**
* Upscale factor
* @default 2
*/
scale?: number;
/**
* Network name for upscaling (required)
* e.g., 'anime4k/cnn-2x-m-an'
*/
networkName: string;
/**
* Weights for the neural network (required)
* Can be a URL string or a pre-loaded weights object
* e.g., '/path/to/weights.json' or { layers: [...] }
*/
weights: string | object;
/**
* Enable comparison mode
* @default false
*/
compare?: boolean;
compare?: boolean
networkSize?: 'small' | 'medium' | 'large'
weightsBaseUrl?: string
workerUrl?: string
videoScale?: number
}
interface Result {
name: 'artplayerPluginWebsr';
/**
* Get WebSR instance
*/
websr: () => any;
/**
* Get GPU context
*/
gpu: () => any;
/**
* Get canvas element
*/
canvas: () => HTMLCanvasElement;
/**
* Enable WebSR upscaling
*/
enable: () => Promise<void>;
/**
* Disable WebSR upscaling
*/
disable: () => void;
/**
* Toggle WebSR upscaling
*/
toggle: () => Promise<void>;
/**
* Check if WebSR is enabled
*/
isEnabled: () => boolean;
/**
* Check if WebSR is initialized
*/
isInitialized: () => boolean;
/**
* Update options at runtime
* Supported options: enabled, weights, networkName, scale
*/
update: (option: Partial<Option>) => Promise<void>;
/**
* Enable comparison mode
*/
enableCompare: () => void;
/**
* Disable comparison mode
*/
disableCompare: () => void;
/**
* Toggle comparison mode
*/
toggleCompare: () => void;
/**
* Set comparison split position (0-1)
*/
setComparePosition: (pos: number) => void;
/**
* Get current comparison split position (0-1)
*/
getComparePosition: () => number;
/**
* Check if comparison mode is enabled
*/
isComparing: () => boolean;
name: 'artplayerPluginWebsr'
upscaler: any
update: (option: Option) => void
}
declare const artplayerPluginWebsr: (option?: Option) => (art: Artplayer) => Result;
declare const artplayerPluginWebsr: (option?: Option) => (art: Artplayer) => Result
export default artplayerPluginWebsr
export = artplayerPluginWebsr;
export as namespace artplayerPluginWebsr;
export = artplayerPluginWebsr
export as namespace artplayerPluginWebsr;