Your SlideShare is downloading. ×
HTML5 New Features and Resources
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

HTML5 New Features and Resources


Published on

  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. HTML5New Features and ResourcesRon Reiter, 2012
  • 2. Whats New?● CSS3● Drag and Drop● localStorage & sessionStorage● IndexedDB● Application Cache Manifest● Native Audio and Video Support● Real-time P2P Video Streaming● Web Intents
  • 3. Whats New? (etc.)● postMessage● File API● Websockets● Canvas & SVG● WebGL● Notifications● Web Workers● Geolocation
  • 4. CSS3 Media QueriesCSS3 media queries are used for responsive design:@media screen and (min-width:480px) and (max-width:800px) { /* Target landscape smartphones, portrait tablets, narrow desktops */}@media screen and (max-width:479px) { /* Target portrait smartphones */}
  • 5. CSS3 New Features● Rounded Corners● Transitions and Animations● 2D & 3D Transformations● Transparency● Box Shadows● Text Effects● Columns, Regions, Exclusions● Custom Filters & GLSL Shaders● Compositing & Blending
  • 6. CSS3 Demos● CSS3 Playground ○● Adobe (Filters, Compositing, Regions) ○ ○ ○ ○● Media Queries ○
  • 7. CSS3 Demos (etc.)● Transitions ○● 3D ○ ○ ○ ○
  • 8. Drag and Drop● Web Application UI ○● Files ○ Desktop to Browser ■ ○ Browser to Desktop ■
  • 9. Storage● localStorage is a persistent key-value store● sessionStorage is the same, only volatile● Client-side only● 5 megabyte limitlocalStorage.setItem(key, value)localStorage.getItem(key)localStorage.removeItem(key)localStorage.clear()
  • 10. IndexedDB● Allows indexed, efficient queries● Transactions● Object basedvar customerData = [ { ssn: "444-44-4444", name: "Bill", age: 35, email: "" }, { ssn: "555-55-5555", name: "Donna", age: 32, email: "" }];var request ="example", 2);var objectStore = db.createObjectStore("customers", { keyPath: "ssn" });objectStore.createIndex("name", "name", { unique: false });objectStore.createIndex("email", "email", { unique: true });for (var i in customerData) { objectStore.add(customerData[i]);}
  • 11. Cache Manifest● Turns web pages into offline applications ○● Example file structure:CACHE MANIFESTindex.htmlstylesheet.cssimages/logo.pngscripts/main.js
  • 12. Media Tags● Audio and video tags● Video can be manipulated using canvas or CSS filters<audio src="test.ogg" autoplay> Your browser does not support the audio element.</audio><video controls> <source src="foo.ogg" type="video/ogg"> <source src="" type="video/quicktime"> Your browser doesnt support the video element.</video>
  • 13. WebRTC● MediaStream API (getUserMedia) - API for utilizing webcams or microphones● PeerConnection API - allows audio and video streaming between peers● Data Channel API - used for P2P data sharing, for directly sending files and raw data between clients not through a server● Get started ○
  • 14. postMessage● Allows cross-domain iframe and window communication using messages and callbacks● The right way to exchange data between two different domains under your control
  • 15. Web Intents● Allows invoking web applications with an intent-like interface, passing data to them● Example - intent = new Intent("", "text/uri-list", "");window.navigator.startActivity(intent);
  • 16. File & File System API● Another local storage interface, but with a file interface, organized in directories● Can be used for accessing real filesystem on PhoneGap● In the future, HTML5 based desktop applications might also be able to access the real filesystem using it
  • 17. Websockets● Message oriented communication ○ Chat, games, and other interactive content● The right way to do server push● Reduces the HTTP headers overhead● No request-response constraint (completely asynchronous)● Emulation libraries ○ sockjs ○
  • 18. SockJS Example// Echo sockjs server (node.js)var sockjs_opts = {sockjs_url: ""};var sockjs_echo = sockjs.createServer(sockjs_opts);sockjs_echo.on(connection, function(conn) { conn.on(data, function(message) { conn.write(message); });});// 1. Echo sockjs client<script src=""></script><script> var sockjs_url = /echo; var sockjs = new SockJS(sockjs_url); sockjs.onopen = function() {console.log([*] open, sockjs.protocol);}; sockjs.onmessage = function(e) {console.log([.] message,;}; sockjs.onclose = function() {console.log([*] close);}; sockjs.send("Hello!");</script>
  • 19. Canvas● Pixel manipulation API● Used for image processing, games (sprites), and more● Examples ○ ○ ○
  • 20. SVG● SVG - Scalable Vector Graphics● Great for scaling graphics to any size, an advantage when dealing with sub-pixel screens (retina)● Examples ○ ○ Column-lower-animated.svg ○
  • 21. WebGL● JavaScript OpenGL interface for 3D programming● Widely adopted● Microsofts IE10 will not support it, claim the standard is not secure● Examples ○ ○ ○
  • 22. Notifications● Allows websites to pop up desktop notifications for open tabsdocument.querySelector(#show_button).addEventListener(click, function() { if (window.webkitNotifications.checkPermission() == 0) { // 0 is PERMISSION_ALLOWED // function defined in step 2 window.webkitNotifications.createNotification( icon.png, Notification Title, Notification content...); } else { window.webkitNotifications.requestPermission(); }}, false);
  • 23. Web Workers● Used for CPU intensive processing● Does not interrupt the UI threadmain.jsvar worker = new Worker(my_task.js);worker.onmessage = function(event) { console.log("Worker said : " +;};worker.postMessage(ali);mytask.jsself.postMessage("Working hard for");self.onmessage = function(event) { self.postMessage(Hi +;};
  • 24. Geolocation
  • 25. Questions?Thank You!