htmldata-url

Is it possible to use data URIs in video and audio tags?


Assuming the following:

  1. The browser in question doesn't limit the size of data URIs.
  2. There is actually a purpose to doing this (so please refrain from asking "what's the point?" and "you do realize base64 encoding will expand your file by 33%, right?").

Is it technically possible to encode an entire video or audio file into base64, and embed it in an HTML document using either <audio> or <video>?


Solution

  • It should be possible, except in IE8 and below, which does not support Audio/Video elements. Note that Opera does limit the size of the URI.