mirror of
https://github.com/codedread/bitjs
synced 2025-10-03 17:49:16 +02:00
Check in some starter thinking around a media API in bitjs.
This commit is contained in:
parent
fc0381b4d2
commit
fce8d69612
3 changed files with 37 additions and 1 deletions
2
.github/workflows/node.js.yml
vendored
2
.github/workflows/node.js.yml
vendored
|
@ -16,7 +16,7 @@ jobs:
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [17.x, 18.x]
|
node-version: [17.x, 18.x, 19.x]
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
1
media/README.md
Normal file
1
media/README.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Dealing with digital media files (audio, video, images). Mostly a thought-experiment for now.
|
35
media/media.js
Normal file
35
media/media.js
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
console.warn(`This is not even an alpha-level API. Do not use.`);
|
||||||
|
|
||||||
|
// A Container Format is a file that embeds multiple data streams into a single file.
|
||||||
|
// Examples:
|
||||||
|
// - the ZIP family (ZIP, JAR, CBZ, EPUB, ODF, OOXML)
|
||||||
|
// - the ISO-BMFF family (MP4, HEVC, AVIF, MOV/QT, etc)
|
||||||
|
// - the Matroska family (MKV, WebM)
|
||||||
|
// - the RIFF family (WAV, AVI, WebP)
|
||||||
|
// - the OGG family (OGV, OPUS)
|
||||||
|
|
||||||
|
// The ZIP container needs special processing to determine what files are present inside it :(
|
||||||
|
// The ISO-BMFF container needs special processing because of its "compatible brands" array :(
|
||||||
|
// The Matroska container needs special processing because the sub-type can appear anywhere :(
|
||||||
|
// The OGG container needs special processing to determine what kind of streams are present :(
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @readonly
|
||||||
|
* @enum {number}
|
||||||
|
*/
|
||||||
|
export const ContainerType = {
|
||||||
|
UNKNOWN: 0,
|
||||||
|
ZIP: 1,
|
||||||
|
ISOBMFF: 100,
|
||||||
|
MATROSKA: 101,
|
||||||
|
RIFF: 102,
|
||||||
|
OGG: 103,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ArrayBuffer} ab
|
||||||
|
* @returns {ContainerType}
|
||||||
|
*/
|
||||||
|
export function getContainerType(ab) {
|
||||||
|
return ContainerType.UNKNOWN;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue