Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
349 views
in Technique[技术] by (71.8m points)

html - 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>?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

These are my test results. I'll try with Ogg as well if prompted.

Legend

  • W = Wave, WD = Wave with base64 encoded data:uri
  • M = MP3, MD = MP3 with base64 encoded data:uri

Test results

  • Chrome 6.0.472.55: M, MD (no wave)
  • Firefox 3.6: W, WD (no mp3:s)
  • Firefox 4.0b1: W, WD (no mp3:s)
  • iPad iOS 3.2: W, M (no data:uri)
  • iPhone iOS 4: W, M (no data:uri)
  • Opera 10.62: W, WD (no mp3:s)
  • Safari 5.0.1: W, WD, M, MD

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...