Top Banner
Brave new world of HTML5 Patrick H. Lauke / Webdirections @media / London / 11 June 2010 THE “NO I'M NOT BRUCE LAWSON” EDITION ( BETA)
49
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Web Directions @media 2010

Brave new world of HTML5

Patrick H. Lauke / Webdirections @media / London / 11 June 2010

THE “NO I'M NOT BRUCE LAWSON” EDITION (BETA)

Page 2: Web Directions @media 2010

Web Evangelist at Opera

Page 3: Web Directions @media 2010

new technologies you can start using today

Page 4: Web Directions @media 2010

HTML5<!DOCTYPE html>

Page 5: Web Directions @media 2010

http://www.flickr.com/photos/24374884@N08/4603715307/

Page 6: Web Directions @media 2010

HTML5 definition without the bullsh*t

Page 7: Web Directions @media 2010

history of HTML5

● started at Opera – Web Applications 1.0● reaction to XHTML 2.0● Google, Mozilla and Apple joined● W3C HTML5● Microsoft involvement

Page 8: Web Directions @media 2010

“...extending the language to better support Web applications [...] This puts HTML in direct competition with other technologies[...] , in particular Flash and Silverlight.”

Ian Hickson, Editor of HTML5http://lists.w3.org/Archives/Public/public-html/2009Jan/0215.html

Page 9: Web Directions @media 2010

HTML5 does not replace HTML 4.01

Page 10: Web Directions @media 2010

HTML5 has more bling!

Page 11: Web Directions @media 2010

HTML5 standardises current browser and authoring behaviour

(e.g. relaxed coding rules)

Page 12: Web Directions @media 2010

HTML5 is stricter?(defines exactly how browsers handle markup/code)

Page 13: Web Directions @media 2010

HTML5 brings newmarkup elements and JavaScript APIs

Page 14: Web Directions @media 2010

new elements for more accurate semantics

Page 15: Web Directions @media 2010

HTML5 elements for a typical blog

Page 16: Web Directions @media 2010
Page 17: Web Directions @media 2010
Page 18: Web Directions @media 2010

unambiguous and machine readable

Page 19: Web Directions @media 2010

current and old browsers “support” these(although some need a little extra help)

header, footer, … { display: block; }

Page 20: Web Directions @media 2010

Internet Explorer needs extra training wheelsdocument.createElement('header');document.createElement('footer');…http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2

Page 21: Web Directions @media 2010

webforms – more powerful form elements

Page 22: Web Directions @media 2010

rich form elements – without JavaScript

<input type=”date”><input type=”time”><input type=”month”><input type=”week”><input type=”datetime” … ><input type=”range”><input type=”number”><input type=”file” multiple><input … autofocus><input … autocomplete>

Page 23: Web Directions @media 2010

type and attributes for built-in validation(of course you should still validate on the server)

<input type=”tel”><input type=”email”><input type=”url”><input … pattern="[a-z]{3}[0-9]{3}"><input … required>Demonstration of webforms

Page 24: Web Directions @media 2010

<video>

Page 25: Web Directions @media 2010

<object width="425" height="344"><param name="movie"

value="http://www.youtube.com/v/9sEI1AUFJKw&hl=en&fs=1&"></param>

<param name="allowFullScreen" value="true"></param>

<param name="allowscriptaccess" value="always"></param>

<embed src="http://www.youtube.com/v/9sEI1AUFJKw&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>

Page 26: Web Directions @media 2010

<video src="video.ogv" controls autoplay poster="poster.jpg" width="320" height="240"> <a href="video.ogv">Download movie</a></video>

Page 27: Web Directions @media 2010

video as native object...why is it important?

● “play nice” with rest of the page● keyboard accessibility built-in● API for controls

Demonstration of video

Page 28: Web Directions @media 2010

video format debate

H.264 vs Ogg Theora

Page 29: Web Directions @media 2010

video format debate

H.264 vs Ogg Theora vs WebM

Page 30: Web Directions @media 2010

video formats – H.264 + OGG Theora + WebM

<video controls autoplay poster="…" width="…" height="…"><source src="movie.webm" type="video/webm" /><source src="movie.ogv" type="video/ogg" /><source src="movie.mp4" type="video/mp4" /><!-- fallback content -->

</video>

still include fallback for old browsershttp://camendesign.com/code/video_for_everybody

Page 31: Web Directions @media 2010

<audio>

Page 32: Web Directions @media 2010

audio exactly the same

<audio src=”music.mp3” controls autoplay></audio>[...]<audio controls autoplay>

<source src="music.mp3" type="audio/mpeg" /><source src="music.oga" type="audio/ogg" /><!-- fallback content -->

</audio>

MP3, Ogg Vorbis, WAVDemonstration: audio

Page 33: Web Directions @media 2010

<canvas>

Page 34: Web Directions @media 2010

canvas = “scriptable images”

<canvas width="…" height="…"></canvas>

Page 35: Web Directions @media 2010

canvas has standard API methods for drawing

ctx = canvas.getContext("2d");ctx.fillRect(x, y, width, height);ctx.beginPath();ctx.moveTo(x, y);ctx.lineTo(x, y);ctx.bezierCurveTo(x1, y1, x2, y2, c1, c2);ctx = canvas.drawImage(…);

Page 36: Web Directions @media 2010

canvas accessibility concerns

Page 37: Web Directions @media 2010

canvas appropriate use for enhanced visuals, special effects – not pure content

Page 38: Web Directions @media 2010

video, audio and canvas on any devicewithout plugins

(Java / Flash / Silverlight not ubiquitous)

Page 39: Web Directions @media 2010
Page 40: Web Directions @media 2010
Page 41: Web Directions @media 2010
Page 42: Web Directions @media 2010
Page 43: Web Directions @media 2010
Page 44: Web Directions @media 2010

But is it safe to use, right now?

Page 45: Web Directions @media 2010

feature-detectionprogressive enhancement, graceful degradation

http://diveintohtml5.org/everything.html

Page 46: Web Directions @media 2010

HTML5 as Flashkiller?

Page 47: Web Directions @media 2010

not a question of HTML5 replacing Flash...

Page 48: Web Directions @media 2010

Giving developers a choice!

Page 49: Web Directions @media 2010

www.opera.com/developerpeople.opera.com/patrickl/presentations/atmedia_11.06.2010/atmedia_11.06.2010.pdf

[email protected]