Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

EFFECT_MEDIA

Package @dioramajs/diorama/effects Level error

The image or video of a media effect has no usable pixels, so the instance failed until the source changes.

View as Markdown
On this page
EFFECT_MEDIA: cannot decode {src}

Why it happens

  • The image did not load: a 404, a wrong path or a network error. The effect waits for the element’s load or error event and then decodes, so a failed request ends as a failed decode.
  • The file is broken, or the browser does not support its format.
  • The image has crossorigin set but the server sends no CORS headers. The browser then refuses the image itself, and the failure shows here instead of as EFFECT_CORS.
  • A video fired loadeddata without data for the current frame. The message then reads video has no data.

A source change during decode is not a failure. When currentSrc changes while the effect decodes, for example on a srcset switch at resize or when a lazy-loading library swaps the source, the effect starts over with the new one.

How to fix

Open the URL from the message in the browser or the network panel and fix the path or the file.

The failure is not final. The instance listens to its element, and the next load (loadeddata for video) with a different currentSrc, or a change of the crossorigin attribute, puts it back to waiting. A corrected source retries without a reload:

const img = document.querySelector<HTMLImageElement>('img[data-dio]')
if (img) img.src = '/img/cover.avif'