mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 03:11:46 +00:00
feat(synced-lyrics): Musixmatch (#3261)
This commit is contained in:
@ -13,6 +13,10 @@ import type { SongInfo } from '@/providers/song-info';
|
||||
import type { SyncedLyricsPluginConfig } from '../types';
|
||||
|
||||
export let _ytAPI: YoutubePlayer | null = null;
|
||||
export let netFetch: (
|
||||
url: string,
|
||||
init?: RequestInit
|
||||
) => Promise<[number, string, Record<string, string>]>;
|
||||
|
||||
export const renderer = createRenderer<
|
||||
{
|
||||
@ -53,7 +57,7 @@ export const renderer = createRenderer<
|
||||
if (!this.updateTimestampInterval) {
|
||||
this.updateTimestampInterval = setInterval(
|
||||
() => setCurrentTime((_ytAPI?.getCurrentTime() ?? 0) * 1000),
|
||||
100,
|
||||
100
|
||||
);
|
||||
}
|
||||
|
||||
@ -73,6 +77,8 @@ export const renderer = createRenderer<
|
||||
},
|
||||
|
||||
async start(ctx: RendererContext<SyncedLyricsPluginConfig>) {
|
||||
netFetch = ctx.ipc.invoke.bind(ctx.ipc, 'synced-lyrics:fetch');
|
||||
|
||||
setConfig(await ctx.getConfig());
|
||||
|
||||
ctx.ipc.on('ytmd:update-song-info', (info: SongInfo) => {
|
||||
|
||||
Reference in New Issue
Block a user