按常见视频容器的 magic bytes 推断视频格式。
待检查的字节序列,可以是 Uint8Array、Buffer 或普通数字数组。
Uint8Array
Buffer
识别到的视频格式;无法识别时返回 null。
null
0.2.0
detectVideoFileFormat(new Uint8Array([0x1a, 0x45, 0xdf, 0xa3])) // 'webm'detectVideoFileFormat(new Uint8Array([71, 73, 70, 56, 57, 97])) // null Copy
detectVideoFileFormat(new Uint8Array([0x1a, 0x45, 0xdf, 0xa3])) // 'webm'detectVideoFileFormat(new Uint8Array([71, 73, 70, 56, 57, 97])) // null
按常见视频容器的 magic bytes 推断视频格式。