codem-isoboxer is a lightweight JavaScript parser for MP4 (MPEG-4, ISOBMFF) files and boxes, primarily designed for browser environments. Its current stable version is 0.3.10, with releases occurring as features and bug fixes are integrated, rather than on a fixed schedule. The library's core purpose is to provide a small, fast, and efficient way to extract metadata and validate ISOBMFF segments, making it suitable for integration into player frameworks or for analyzing media files. Key differentiators include its focus on minimal overhead, direct manipulation of ArrayBuffers and DataViews, and specific support for boxes relevant to emerging standards like MPEG-DASH (e.g., `emsg` boxes) and HLS using fragmented MP4, as well as timed text overlays. It offers a relatively raw interface, providing box structures with minimal abstraction, allowing developers fine-grained control over parsing and data access.
npm install codem-isoboxerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to parse an `ArrayBuffer` containing ISOBMFF data using `ISOBoxer.parseBuffer` and then how to retrieve specific boxes using `fetch` and `fetchAll` methods from the resulting `ParsedFile` object. It includes a mock for `ISOBoxer` to make the code runnable outside a browser environment for testing purposes, but in a real browser, `ISOBoxer` is a global.
Include the library via a `<script>` tag in your HTML (`<script src="path/to/iso_boxer.min.js"></script>`) and access its functionality through the global `ISOBoxer` object.
Consult the 'Box Support' wiki page on GitHub. For unsupported boxes, refer to the `src/parsers` directory in the source code to understand how to add new box parsers.
Be prepared to implement additional logic to interpret the specific data structures within the parsed boxes, especially for more complex or application-specific fields. Understand the ISOBMFF specification for the boxes you are parsing.
Ensure your target browser environment supports these APIs. For Node.js usage, consider alternative libraries or integrate polyfills for the required browser APIs.
Ensure the `iso_boxer.min.js` script is correctly included in your HTML before attempting to use `ISOBoxer`. Verify the script path and that it's loaded synchronously or before your script executes.
Check the network tab in your browser's developer tools to confirm `iso_boxer.min.js` loaded successfully without errors. Ensure no other script is overwriting the `ISOBoxer` global variable.
Ensure you are passing a valid `ArrayBuffer` instance to `ISOBoxer.parseBuffer`. Common mistakes include passing a `Blob`, `File` object, or `Uint8Array` directly without converting to `ArrayBuffer` first (e.g., `await blob.arrayBuffer()`).
No dependency data recorded yet.