-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdemo.html
50 lines (42 loc) · 2.58 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8 />
<title>Weppy Demo</title>
<style>
* {
font-family: sans-serif, arial, helvetica;
font-size: 13px;
}
</style>
<script src="weppy.js"></script>
</head>
<body>
<h1>Weppy Demo: WebP in modern browsers <i>today</i></h1>
<img src="tinybrot.webp" alt="Mandelbrot Set">
<h2>Demo Code</h2>
<script src="http://gist.github.com/608701.js"> </script>
<h2>How does it work?</h2>
WebP is actually a lightweight container for a single VP8 frame (whereas WebM is a container based off Matroska meant for video). WebM support exists already in Chrome, Firefox and Opera, so all that's needed to render it is to do a little magic to convert the RIFF encoded WebP image into a EBML/Matroska encoded single frame WebM video, loading it in a <video> and replacing the <tt>.webp</tt> image with the <video> element.
<h2>What Browsers?</h2>
<img src="browsers.webp" alt="Chrome, Firefox and Safari" style="float:right">
Chrome 7.0, Opera 10.62, and Firefox 4.0 were tested and functional. It should work in all browsers that support WebM video.
<h2>Me</h2>
I'm <a href='http://twitter.com/antimatter15'>@antimatter15</a> (please help me get my followed/following ratio over 1.0!). I know practically nothing about video, VP8, Matroska, EBML, WebP, WebM, codecs, binary, compression though all of them fascinate me, and I loved <a href="http://www.xiph.org/video/vid1.shtml">"A Digital Media Primer for Geeks"</a>. At time of writing I'm fifteen, though I don't find that much of an accomplishment. My site is at <a href="http://antimatter15.com">antimatter15.com</a> and hopefully you'll find some other cool stuff there too.
<h2>Credits</h2>
<ul>
<li>The Mandelbrot set pic was stolen from Wikipedia.</li>
<li><a href="http://twitter.com/#!/paul_irish/status/26829179917">@paul_irish</a> for the WebP browser support detection code</li>
<li><a href="http://twitter.com/Frenzie">@Frenzie</a> for information on how to get it to work on Opera</li>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-17007539-4']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>