mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 02:51:20 -08:00
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:
1 parent
687a34c6b3
commit
cfaaea6a5c
72 files changed
+436
-392
No files matched your search
@@ -1,92 +1,17 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
|
||||
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;
|
||||
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;
|
||||
upscaler: any;
|
||||
update: (option: Option) => void;
|
||||
}
|
||||
|
||||
declare const artplayerPluginWebsr: (option?: Option) => (art: Artplayer) => Result;
|
||||
|
||||
Reference in new issue
Block a user