mirror of
https://github.com/lqtmcstudio/QZMusic_PC.git
synced 2026-06-28 12:24:29 +08:00
fork(fix): Clone AMLL 并修复 BUG
- 将AMLL Clone到本以地进行修复和优化(emm虽然这很不优雅但是暂时无时间做子模块和Fork) - 修复在当前播放歌词行不可见的视口Seek会出现滚动偏移的问题
This commit is contained in:
22
amll-local/packages/lyric/src/formats/ttml.ts
Normal file
22
amll-local/packages/lyric/src/formats/ttml.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import {
|
||||
exportTTML,
|
||||
parseTTML as parseTTMLPacked,
|
||||
} from "@applemusic-like-lyrics/ttml";
|
||||
import type { TTMLLyric } from "../types";
|
||||
|
||||
/**
|
||||
* 解析 TTML 格式(包含 AMLL 特有属性信息)的歌词字符串
|
||||
* @param ttmlText 歌词字符串
|
||||
* @returns 成功解析出来的 TTML 歌词对象
|
||||
*/
|
||||
export function parseTTML(ttmlText: string): TTMLLyric {
|
||||
return parseTTMLPacked(ttmlText);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将歌词数组转换为 TTML 格式(包含 AMLL 特有属性信息)的歌词字符串
|
||||
* @param ttmlLyric TTML 歌词对象
|
||||
*/
|
||||
export function stringifyTTML(ttmlLyric: TTMLLyric): string {
|
||||
return exportTTML(ttmlLyric);
|
||||
}
|
||||
Reference in New Issue
Block a user