Baby's first HTML5 <video> element

<baby-video> is a from-scratch re-implementation of the <video> element, built on WebCodecs, Web Audio and a hand-written MediaSource. It's here to show how video playback works inside a browser, including playing video backwards.

Big Buck Bunny © Blender Foundation, licensed under CC BY 3.0.

Experiments

Try it in both modes, and compare what happens to the video.

A bug on purpose: when playing backwards, feed the decoder its frames in reverse order, instead of in decode order.

Frames

From requestVideoFrameCallback() and getVideoPlaybackQuality(). Play at 2× or block the main thread to drop some frames.

Presented
0
Dropped
0
Total
0
Callback rate
–
Media time
–
Frame size
–
Processing
–

Buffer

The demo keeps 30 seconds buffered in the direction of playback and 10 seconds behind. Switch direction and watch the window flip. With loop on, it buffers across the jump between the end and the start.

Around the playhead

Whole video

Events