Timelinx

Media Web

Browser-native adapters for video decoding, audio waveforms, compositing, and export

@timelinx/media-web provides browser-native implementations of the pipeline contracts defined in @timelinx/core. The core package defines what a video decoder, compositor, and thumbnail provider look like - @timelinx/media-web implements them using WebCodecs, WebGL, Web Audio, and the MediaRecorder API.

What This Package Provides

AdapterBrowser APICore contract
WebCodecsDecoderAdapterWebCodecsVideoDecoder
WebAudioWaveformAdapterWeb Audio APIAudioDecoder (waveform variant)
ThumbnailExtractorAdapter<video> elementThumbnailProvider
WebGLCompositorAdapterWebGL 2Compositor
SimpleExportAdapterMediaRecorderexport utility

Each adapter is a class that implements a single contract from @timelinx/core/types/pipeline. The adapters are independent - use only the ones you need.


Browser Support

FeatureChromeSafariFirefox
WebCodecs94+16.4+Not supported
Web Audio APIAll modernAll modernAll modern
WebGL 2All modernAll modernAll modern
OffscreenCanvas69+16.4+105+
MediaRecorderAll modern14.1+All modern

Firefox and WebCodecs

WebCodecs is not available in Firefox. Use isSupported() on WebCodecsDecoderAdapter before passing it to the pipeline. Without a video decoder, you can still use the editor for editing - only playback is affected.


Capability Detection

import { getBrowserMediaCapabilities } from '@timelinx/media-web';

const caps = getBrowserMediaCapabilities();
// {
//   webCodecs: boolean,
//   webAudio: boolean,
//   webgl2: boolean,
//   offscreenCanvas: boolean,
//   captureStream: boolean,
// }

if (!caps.webCodecs) {
  // Show a banner: "Playback is not supported in this browser."
}

Package Status

@timelinx/media-web is currently marked "private": true and is not published to npm. It ships as a workspace-local package intended for use in the apps/demo and apps/editor applications. To use it in your own app, copy it into your monorepo or wait for the public release.


Pages in This Section

On this page