mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 11:21:46 +00:00
feat: migrate to new plugin api
Co-authored-by: Su-Yong <simssy2205@gmail.com>
This commit is contained in:
50
src/plugins/crossfade/index.ts
Normal file
50
src/plugins/crossfade/index.ts
Normal file
@ -0,0 +1,50 @@
|
||||
import { createPluginBuilder } from '../utils/builder';
|
||||
|
||||
export type CrossfadePluginConfig = {
|
||||
enabled: boolean;
|
||||
fadeInDuration: number;
|
||||
fadeOutDuration: number;
|
||||
secondsBeforeEnd: number;
|
||||
fadeScaling: 'linear' | 'logarithmic' | number;
|
||||
}
|
||||
|
||||
const builder = createPluginBuilder('crossfade', {
|
||||
name: 'Crossfade [beta]',
|
||||
restartNeeded: true,
|
||||
config: {
|
||||
enabled: false,
|
||||
/**
|
||||
* The duration of the fade in and fade out in milliseconds.
|
||||
*
|
||||
* @default 1500ms
|
||||
*/
|
||||
fadeInDuration: 1500,
|
||||
/**
|
||||
* The duration of the fade in and fade out in milliseconds.
|
||||
*
|
||||
* @default 5000ms
|
||||
*/
|
||||
fadeOutDuration: 5000,
|
||||
/**
|
||||
* The duration of the fade in and fade out in seconds.
|
||||
*
|
||||
* @default 10s
|
||||
*/
|
||||
secondsBeforeEnd: 10,
|
||||
/**
|
||||
* The scaling algorithm to use for the fade.
|
||||
* (or a positive number in dB)
|
||||
*
|
||||
* @default 'linear'
|
||||
*/
|
||||
fadeScaling: 'linear',
|
||||
} as CrossfadePluginConfig,
|
||||
});
|
||||
|
||||
export default builder;
|
||||
|
||||
declare global {
|
||||
interface PluginBuilderList {
|
||||
[builder.id]: typeof builder;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user