fix: MP4 fullbox偏移修正+标题全角/半角斜杠换行 #1440

Closed
xiaoxia wants to merge 1 commits from fix/fullbox-offset-and-title-split into develop
@@ -28,8 +28,8 @@ function findCodecConfig(buffer: ArrayBuffer, start: number, end: number): Array
// 容器 boxfullbox 多 4 字节)
const containerBoxes = ["trak", "mdia", "minf", "stbl"]
if (containerBoxes.includes(type)) {
// stbl 是 fullbox,跳过 4 字节 version/flags
const contentStart = offset + 8
// fullbox: size(4) + type(4) + version(1) + flags(3) = 12 bytes header
const contentStart = offset + 12
const result = findCodecConfig(buffer, contentStart, offset + size)
if (result) return result
} else if (type === "stsd") {
@@ -431,7 +431,7 @@ export function useCanvasPlayer(
ctx.textAlign = "center"
// 按 "/" 分割为多行("/" 作为手动换行符)
const lines = title.text.split("/")
const lines = title.text.split(/[/]/)
const lineHeight = fontSize * 1.3
const totalHeight = lines.length * lineHeight