![Page 1: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/1.jpg)
HTML5, Flash and the Battle for Faster Cat VideosBy YouTube's Greg Schechter and Chris Rhodes
![Page 3: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/3.jpg)
![Page 4: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/4.jpg)
HTML + JS + CSS + Awesomeness
![Page 5: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/5.jpg)
Offline File Access Multimedia Performance Presentation Graphics Storage
HTML5
![Page 6: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/6.jpg)
Offline File Access Multimedia Performance Presentation Graphics Storage
HTML5
![Page 7: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/7.jpg)
Translation
![Page 8: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/8.jpg)
HTML5 ~=
By geishaboy500http://www.flickr.com/photos/geishaboy500/3183872667/
![Page 9: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/9.jpg)
99% connected desktop penetration?http://www.adobe.com/products/player_census/flashplayer/
![Page 10: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/10.jpg)
Why HTML5?
![Page 11: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/11.jpg)
Features Accessibility "Device-ability"Security Embeds API
HTML5 vs Flash
![Page 12: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/12.jpg)
Round 1: Features
http://www.flickr.com/photos/zipckr/4624150058/
![Page 13: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/13.jpg)
Why Flash?Features missing in HTML5
● Content protection
![Page 14: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/14.jpg)
Why Flash?Features missing in HTML5
● Content protection○ RTMPE protocol / Flash Access
![Page 15: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/15.jpg)
Why Flash?Features missing in HTML5
● Content protection○ RTMPE protocol / Flash Access
● Camera & Microphone Access
![Page 16: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/16.jpg)
Why Flash?Features missing in HTML5
● Content protection○ RTMPE protocol / Flash Access
● Camera & Microphone Access● Adaptive & Live Streaming
![Page 17: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/17.jpg)
Why Flash?Features missing in HTML5
● Content protection○ RTMPE protocol / Flash Access
● Camera & Microphone Access● Adaptive & Live Streaming● Fullscreen video
![Page 18: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/18.jpg)
Why Flash?Features missing in HTML5
● Content protection○ RTMPE protocol / Flash Access
● Camera & Microphone Access● Adaptive & Live Streaming● Fullscreen video
○ Hardware accelerated HD cat videos!○ **API available in webkit and gecko
![Page 19: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/19.jpg)
Why Flash?Webkit Fullscreen API
var elem = document.getElementById("my-element");document.onwebkitfullscreenchange = function() {// The fullscreen element:// document.webkitFullScreenElement;console.log ("We went fullscreen!");};elem.webkitRequestFullScreen();
![Page 20: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/20.jpg)
Why Flash?Features missing in HTML5
● Content protection○ RTMPE protocol / Flash Access
● Camera & Microphone Access● Adaptive & Live Streaming● Fullscreen video
○ HD, hardware accelerated cat videos!○ **API available in webkit and gecko
![Page 21: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/21.jpg)
Why Flash?Features missing in HTML5
● Content protection○ RTMPE protocol / Flash Access
● Camera & Microphone Access● Adaptive & Live Streaming ● Fullscreen video
○ HD, hardware accelerated cat videos!○ **API available in webkit and gecko
● Consistent format support
![Page 22: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/22.jpg)
Why Flash?Features missing in HTML5
● Content protection○ RTMPE protocol / Flash Access
● Camera & Microphone Access● Adaptive & Live Streaming● Fullscreen video
○ HD, hardware accelerated cat videos!○ **API available in webkit and gecko
● Consistent format support○ HTML5 needs to support both H.264 and WebM
![Page 23: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/23.jpg)
Why Flash?Features missing in HTML5
● Content protection○ RTMPE protocol / Flash Access
● Camera & Microphone Access● Adaptive & Live Streaming● Fullscreen video
○ HD, hardware accelerated cat videos!○ **API available in webkit and gecko
● Consistent format support○ HTML5 needs to support both H.264 and WebM
● Cross platform consistency****
![Page 24: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/24.jpg)
Why HTML5?<video> Expectations
● Open source technology○ Browser / Player / Codec
![Page 25: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/25.jpg)
Why HTML5?<video> Expectations
● Open source technology○ Browser / Player / Codec
● Lower latency○ No plug-in instantiation
![Page 26: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/26.jpg)
Why HTML5?<video> Expectations
● Open source technology○ Browser / Player / Codec
● Lower latency○ No plug-in instantiation
● Better performance and fidelity
![Page 27: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/27.jpg)
Why HTML5?<video> Expectations
![Page 28: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/28.jpg)
Why HTML5?<video> Expectations
● Open source technology○ Browser / Player / Codec
● Lower latency○ No plug-in instantiation
● Better performance and fidelity○ Power Consumption
● Accessibility
![Page 29: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/29.jpg)
Why HTML5?<video> Expectations
http://imgs.xkcd.com/comics/in_ur_reality.png
![Page 30: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/30.jpg)
Why HTML5?<video> Expectations
● Open source technology○ Browser / Player / Codec
● Lower latency○ No plug-in instantiation
● Better performance and fidelity○ Power Consumption
● Accessibility○ User agents can have special video handling
![Page 31: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/31.jpg)
Please put on your3D Glasses
![Page 32: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/32.jpg)
By jmettrauxhttp://www.flickr.com/photos/jmettraux/4959258811/
![Page 33: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/33.jpg)
Why HTML5?3D
● Flash○ Build for graphics○ Tools for easy video manipulation
■ HTML5 would require WebGL or Canvas
● HTML5○ Easy integration with browser and
devices○ Open Standard○ Allows for innovations by the browser
vendors as well as YouTube
![Page 34: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/34.jpg)
Round 2: Device-ability
By dakinyhttp://www.flickr.com/photos/dakiny/4430765149/
![Page 35: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/35.jpg)
Why HTML5?HTML5 Capable Browsers (~75%)
![Page 36: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/36.jpg)
Why HTML5?Flash Support vs. HTML5 Support
![Page 37: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/37.jpg)
Why HTML5?YouTube Data API Usage for Flash vs. HTML5 Devices
![Page 38: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/38.jpg)
Why HTML5?
![Page 39: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/39.jpg)
When HTML5?
![Page 40: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/40.jpg)
Primary Goal:Recover playbacks that would
be lost without flash
![Page 41: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/41.jpg)
Our Solution
![Page 42: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/42.jpg)
<iframe type="text/html" width="640" height="385" frameborder="0" src="http://www.youtube.com/embed/VIDEO_ID" allowfullscreen></iframe>
![Page 43: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/43.jpg)
When HTML5?<iframe> Embed
● Give the user HTML5 or Flash based on device and user preferences.
● Allows for better mobile support.● Offers an "it just works" experience.
![Page 44: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/44.jpg)
Why an iframe?Other embedding methods
● <script>○ We need our content to be sandboxed○ More than just a video tag
● <object>○ Can load content with the data attribute○ But no way to interact with it
![Page 45: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/45.jpg)
When HTML5?When does the user get HTML5?
![Page 46: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/46.jpg)
When HTML5?Detecting HTML5
var videoElement = document.createElement('video');if (videoElement && videoElement.canPlayType && (videoElement.canPlayType('video/mp4; codecs="avc1.42001E, mp4a.40.2"') || videoElement.canPlayType('video/webm; codecs="vp8.0, vorbis"'))) { // Sweet, we can use HTML5!}
![Page 47: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/47.jpg)
When HTML5?When does the user get HTML5?
![Page 48: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/48.jpg)
Round 3: Performance
By Two Hawk's Eyehttp://www.flickr.com/photos/mycoolpics/92033686/
![Page 49: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/49.jpg)
Player Start Time
TODO(schechter): Add csi screen captures
500ms
(Up from 200ms in Jan 2011)
Flash
HTML5
![Page 50: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/50.jpg)
iframe Embed Time Till Thumbnail Visible
Flash - 5.1s
HTML5 - 1.4s
*Collected data shows faster load times than this control environment, but the comparison is actuate.
![Page 51: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/51.jpg)
Get Video Time
![Page 52: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/52.jpg)
Get Video Time
● HTML5:○ Opera is Awesome
■ 200ms ahead of the pack● Flash: IE9 and Opera are the leaders
○ 300ms faster● HTML5 is almost always faster than Flash
○ 300ms - 400ms faster○ IE9 is an exception
■ IE9 Flash is slightly faster than IE9 HTML5
![Page 53: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/53.jpg)
Video Start Time
HTML5
Flash 2.5s
![Page 54: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/54.jpg)
Video Start Time
HTML5
Flash 2.5s
● Firefox closest to catching Flash○ HTML5 ~1.0s slower than Flash
![Page 55: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/55.jpg)
So why is Flash so fast?
![Page 56: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/56.jpg)
Make Assumptions
![Page 57: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/57.jpg)
Making Assumptions
● Most users have a recent version of flash
● Thus we can optimistically embed the most common case and do version checking and updating after a script loads
● 250ms improvement to flash start time
![Page 58: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/58.jpg)
Preload Video Connection
![Page 59: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/59.jpg)
Preload Video Connection
● Resolves DNS while page is rendering● Maintains an open connection● 200ms improvement
<head> <script> var img = new Image(); img.src = videoConnectionUrl; </script></head>
![Page 60: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/60.jpg)
What about embeds?
![Page 61: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/61.jpg)
#1 cache
![Page 62: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/62.jpg)
1. youtube.com/v/di5I49yg7bY 302 redirect2. s.ytimg.com/swf/l.swf?args&swf=swf2-hash_url.swf3. s.ytimg.com/swf/swf2-hash_url.swf ~150kb
![Page 63: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/63.jpg)
1. youtube.com/v/di5I49yg7bY 3022. s.ytimg.com/swf/l.swf?args&swf=swf2-hash_url.swf3. s.ytimg.com/swf/swf2-hash_url.swf
1. youtube.com/v/di5I49yg7bY application/x-shockwave-flash2. s.ytimg.com/swf/swf2-hash_url.swf
Better
![Page 64: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/64.jpg)
1. youtube.com/v/di5I49yg7bY 3022. s.ytimg.com/swf/l.swf?args&swf=swf2-hash_url.swf3. s.ytimg.com/swf/swf2-hash_url.swf
1. youtube.com/v/di5I49yg7bY application/x-shockwave-flash2. s.ytimg.com/swf/swf2-hash_url.swf
1. youtube.com/embed/di5I49yg7bY text/html2. s.ytimg.com/swf/swf2-hash_url.swf
Best
![Page 65: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/65.jpg)
#2 lazy load
![Page 66: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/66.jpg)
Most embeds are never played.
![Page 67: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/67.jpg)
● Delay expensive queries.● Use cache for most videos.● Delay loading... flash?
![Page 69: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/69.jpg)
Player API
http://code.google.com/apis/youtube/getting_started.html#player_apis
![Page 70: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/70.jpg)
The JavaScript APICommunication
![Page 71: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/71.jpg)
The JavaScript APICommunication
● Poll the URL fragment? http://youtube.com/embed/video_id#fragment
![Page 72: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/72.jpg)
The JavaScript APICommunication
● Poll the URL fragment?http://youtube.com/embed/video_id#fragment
● Messages are one dimensional.● Polling eats up CPU and is not instant.● Both directions of communication use the same
fragment.
![Page 73: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/73.jpg)
The JavaScript APICommunication
● Better idea: PostMessage API.someWindow.postMessage(message, targetOrigin);
![Page 74: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/74.jpg)
The JavaScript APICommunication
● Better idea: PostMessage API.someWindow.postMessage(message, targetOrigin);
● Uses JSON for native encoding and decoding of data.● No polling.● Native event listeners.● Communications are sandboxed per-window.● Calls are asynchronous.
![Page 75: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/75.jpg)
Conclusion
● Flash is still preferred in most places○ More critical features○ Deeper reach
● HTML5 is awesome○ Improves every day○ Greater mobile reach○ People want it
![Page 76: JS Days HTML5 Flash and the Battle for Faster Cat Videos](https://reader033.vdocument.in/reader033/viewer/2022042814/55514f33b4c905bd1c8b55f7/html5/thumbnails/76.jpg)
Questions?
[email protected] [email protected]
can haz question?By cloudzilla http://www.flickr.com/photos/cloudzilla/378829651/