3. Do I need to wait forthe specifications are complete?
4. Real-world browser support is what matters!
5. A desktop example http://www.pirateslovedaisies.com/
6. A mobile examplehttp://m.microsoft.com/windowsphone/en-us/demo/index.html
7. The current state of HTML5 support http://caniuse.com/
8. Why programming?
9. This presentation doesn’t cover• Semantics & Markups• HTML5 Forms• Web Workers• WebGL• CSS3• SVG• …
10. This presentation covers• Video• Canvas• WebSocket• Data Storage• Offline• FileSystem• Geolocation
11. MultimediaThese specifications defines the video/audio elements with all the availablemethods, attributes and events. Through the new APIs you can access, controland manipulate timeline data and network states of the files. With the comingadditions to the APIs you will be able to read and write raw data to audio files(Audio Data API) or manipulate captions in videos (Timed Track API).
15. CanvasThe canvas element provides scripts with a resolution-dependent bitmapcanvas, which can be used for rendering graphs, game graphics, or other visualimages on the fly.
17. WebSocketTo enable Web applications to maintain bidirectional communications withserver-side processes, this specification introduces the WebSocket interface.
18. WebSocket• WebSocket object• New protocol – ws://html5rocks.websocket.org/echo• Establishing an open connection – Client and server can send data at any time – Realtime web application
19. WebSocket example
20. Web StorageThis specification introduces two related mechanisms, similar to HTTP sessioncookies, for storing structured data on the client side.
21. Web storage• Avoiding HTTP overhead of cookies• Key-value pairs• Local storage• Session storage• Quota – Needing user confirmation if exceeding storage capability
22. Indexed DatabaseThis specification defines APIs for a database of records holding simple valuesand hierarchical objects. Each record consists of a key and some value.Moreover, the database maintains indexes over records it stores. An applicationdeveloper directly uses an API to locate records either by their key or by using anindex. A query language can be layered on this API. An indexed database can beimplemented using a persistent B-tree data structure.
23. Indexed database• Object based data store• Asynchronous API• Execute commands and open cursor inside transactions
24. Opening indexed database
25. Creating an Object Store
26. Storing data into Object Store
27. Querying data by cursor
28. OfflineIn order to enable users to continue interacting with Web applications anddocuments even when their network connection is unavailable — forinstance, because they are traveling outside of their ISPs coverage area —authors can provide a manifest which lists the files that are needed for the Webapplication to work offline and which causes the users browser to keep a copyof the files for use offline.
32. FileSystemThis specification defines an API to navigate file system hierarchies, and definesa means by which a browser may expose sandboxed sections of a users localfile system to web applications.
33. File system• Sandboxed environment• Allow create/edit/delete files and directories
34. GeolocationThe Geolocation API defines a high-level interface to location informationassociated only with the device hosting the implementation, such as latitudeand longitude. The API itself is agnostic of the underlying location informationsources. Common sources of location information include Global PositioningSystem (GPS) and location inferred from network signals such as IP address,RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs, as well asuser input. No guarantee is given that the API returns the devices actuallocation.
35. Geolocation• Allow users to share their location for location-aware services – Application >> Browser >> 3rd services such as Skyhook or Google• Privacy – Users are asked to share their location• navigator.geolocation – getCurrentPosition – watchPosition• Location metadata – latitude/longtitude/altitude – accuracy/altitudeAccuracy – heading/speed