SlideShare ist ein Scribd-Unternehmen logo
1 von 73
Downloaden Sie, um offline zu lesen
HTML5 vs. Flash
Where Flash isn’t needed anymore
Remy Sharp
@rem
Sometimes does
flash-ing
1. video & Audio
2. Real-time
3. Graphics
Video killed the
radio Flash star?
Who would jump to create
 another video player?
IE9 & all others
   supported
<video src="dizzy.mp4"></video>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset=utf-8 />
  <title>Video Example</title>
</head>
<body>
<video src="dizzy.mp4" controls></video>
</body>
</html>
<video src="dizzy.mp4" controls></video>
<video controls>
  <source type="video/mp4" src="dizzy.mp4" codecs="avc1.42E01E, mp4a.40.2">
  <source type="video/webm" src="dizzy.webm" codecs="vp8, vorbis">
  <source type="video/ogg" src="dizzy.ogv" codecs="theora, vorbis">
</video>
<video controls>
  <source type="video/mp4" src="dizzy.mp4">
  <source type="video/webm" src="dizzy.webm">
  <source type="video/ogg" src="dizzy.ogv">
</video>
<video controls>
  <source src="dizzy.mp4">
  <source src="dizzy.webm">
  <source src="dizzy.ogv">
</video>
<video controls>
  <source src="dizzy-hd.mp4" media="(min-device-height: 720px)">
  <source src="dizzy-regular.mp4">
  <...>
</video>
Video for Everybody
<video width="640" height="360" poster="dizzy.jpg" controls>
  <source src="dizzy.mp4" type="video/mp4" />
  <source src="dizzy.web" type="video/webm" />
  <source src="dizzy.ogv" type="video/ogg" /><!--[if gt IE 6]>
  <object width="640" height="375" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"><!
  [endif]--><!--[if !IE]><!-->
  <object width="640" height="375" type="video/quicktime" data="dizzy.mp4">
  <!--<![endif]-->
  <param name="src" value="dizzy.mp4" />
  <param name="showlogo" value="false" />
  <object width="640" height="380" type="application/x-shockwave-flash"
    data="player.swf?image=dizzy.jpg&amp;file=dizzy.mp4">
    <param name="movie" value="player.swf?image=dizzy.jpg&amp;file=dizzy.mp4" />
    <img src="dizzy.jpg" width="640" height="360" alt="Title of video"
         title="No video playback capabilities, please download the video below" />
  </object><!--[if gt IE 6]><!--></object><!--<![endif]-->
</video>
<p>Download Video: <a href="dizzy.mp4">High Quality "MP4"</a> | <a href="dizzy.ogv">Low Quality "OGG"</a></p>




                         http://camendesign.com/code/video_for_everybody
Scripting
var video = document.getElementById('myVideo');
if (video.paused) {
  video.play();
}
var video = document.getElementById('myVideo');
if (video.paused) {
  video.play();
}

// position & asTime defined elsewhere
video.addEventListener('timeupdate', function () {
  positon.innerHTML = asTime(this.currentTime);
}, false);
Simple API
Methods: play(), pause(), canPlayType(mime)

Properties: currentTime, paused, duration,
loop, autoplay, muted, volume, etc

Events: loadedmetadata, canplay, progress,
play, pause, seeking, timeupdate, etc
Fullscreen?
  Warning! User agents should not provide a public API to
cause videos to be shown full-screen. A script, combined with a
carefully crafted video file, could trick the user into thinking a
system-modal dialog had been shown, and prompt the user for
a password. There is also the danger of "mere" annoyance, with
pages launching full-screen videos when links are clicked or
pages navigated. Instead, user-agent specific interface features
may be provided to easily allow the user to obtain a full-screen
playback mode.
1. No plugins required
2. Simple API: play, pause, etc
3. Video & Audio: the same
4. HTML & CSS - no compile or
   different skills required
1. Codecs
2.Our friend IE
Flash will be needed
as a backup to video
   for a while yet.
Realtime
http://rem.im/collab-drawing.html
WebSocket
•Low latency

• Bi-directional

• No same-original rules

• Chrome, Safari, MobileSafari & Firefox

• Fallback on Flash...ironically
WebSocket
var ws = new WebSocket("ws://myserver.com/");

ws.onmessage = function (event) {
   var data = JSON.parse(event.data);
};

ws.onclose = function () {};

ws.onopen = function () {};
ws.onmessage = function (event) {
   var data = JSON.parse(event.data);
};



   All message data lives here
EventSource
•Server pushed events

• Same-original rules apply

• Can fallback with JavaScript
EventSource
var es = new EventSource("/x-service/");

es.onmessage = function (event) {
   var data = JSON.parse(event.data);
};

es.onopen = function () {};
Graphics
2D Graphics
Canvas
  API
HTML5
<canvas></canvas>




var canvas = document.getElementsByTagName(‘canvas’)[0],
    ctx = canvas.getContext(‘2d’);




            2D drawing API
canvas.getContext(‘2d’)
Google Analytics - Flash charts




Interactive Demo - Canvas charts
function canvas(w, h) {
  var ctx = document.createElement('canvas').getContext('2d'),
      canvas = ctx.canvas;
  canvas.width = w;
  canvas.height = h;
  return ctx;
}

var rainbow = canvas(100, 1),
    rainbowGrad = createRainbow(rainbow);

rainbow.fillStyle = rainbowGrad;
var imageData = rainbow.getImageData(0, 0, 100, 1),
    pixels = imageData.data;

// loop over each pixel and create the dot image
for (var i = 0; i < pixels.length; i += 4) {
  createPoint(pixels, i);
}
function createPoint(pixels, i) {                  // remove shadow
  var dot = canvas(24, 24);                        dot.shadowBlur = 0;
                                                   dot.shadowColor = 'rgba(0,0,0,0)';
  // outer white circle
  dot.fillStyle = '#fff';                          dot.fillStyle = 'rgb(' + [
  dot.arc(12, 12, 10, 0, Math.PI * 2, true);         pixels[i],   // red
                                                     pixels[i+1], // green
  // drop shadow                                     pixels[i+2] // blue
  dot.shadowBlur = 2;                              ].join(',') + ')';
  dot.shadowColor = 'rgba(0,0,0,.7)';
  dot.shadowOffsetX = 2;                           // start inner circle
  dot.shadowOffsetY = 2;                           dot.beginPath();
                                                   dot.arc(12, 12, 8, 0, Math.PI*2, true);
  // fill outer ring
  dot.fill();                                      // fill inner circle
                                                   dot.fill();

                                                   new google.maps.MarkerImage(
                                                      dot.canvas.toDataURL('image/png')
                                                   );
                                               }
new google.maps.MarkerImage(
   dot.canvas.toDataURL('image/png')
);
1. Timer paints video into
   canvas

2. Reads all pixels for bright
   spots

3. Translates to the vector

4. Draws selected input
                                 http://blog.mozbox.org/post/2009/04/12/Firefox-35%3A-a-new-experiment-with-Canvas-Video
1. Flash and canvas share the same
   black box features
2. People will abuse the technology
Scalable
Vector
Graphics
...using Flash!
Raphaël.js
3D
CSS
Yeah, 3D CSS.
#canvas {
  -webkit-perspective: 800;
  -webkit-perspective-origin: 50% 20em;
}

#rubiks {
  -webkit-transform-style: preserve-3d;
  -webkit-transform: rotateX(15deg) rotat
}

#rubiks .face1 {
  -webkit-transform: rotateX(90deg) trans
}

#rubiks .face2 { /* front */
  -webkit-transform: translateZ(10.8em);
}

#rubiks .face3 {
  -webkit-transform: rotateY(90deg) trans
}

#rubiks .face4 { /* back face */
  -webkit-transform: rotateY(180deg) tran
}

#rubiks .face5 {
  -webkit-transform: rotateY(-90deg) tran
WebGL
Mobile?
...or just ask
a question :)


- @rem

Weitere ähnliche Inhalte

Was ist angesagt?

#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
Justin Cataldo
 
HTML5 & The Open Web - at Nackademin
HTML5 & The Open Web -  at NackademinHTML5 & The Open Web -  at Nackademin
HTML5 & The Open Web - at Nackademin
Robert Nyman
 
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Thomas Fuchs
 

Was ist angesagt? (20)

#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
HTML5 & The Open Web - at Nackademin
HTML5 & The Open Web -  at NackademinHTML5 & The Open Web -  at Nackademin
HTML5 & The Open Web - at Nackademin
 
Enjoy the vue.js
Enjoy the vue.jsEnjoy the vue.js
Enjoy the vue.js
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
 
Web Crawling with NodeJS
Web Crawling with NodeJSWeb Crawling with NodeJS
Web Crawling with NodeJS
 
jQuery (BostonPHP)
jQuery (BostonPHP)jQuery (BostonPHP)
jQuery (BostonPHP)
 
jQuery (DrupalCamp Toronto)
jQuery (DrupalCamp Toronto)jQuery (DrupalCamp Toronto)
jQuery (DrupalCamp Toronto)
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
Making your Angular.js Application accessible
Making your Angular.js Application accessibleMaking your Angular.js Application accessible
Making your Angular.js Application accessible
 
How Kris Writes Symfony Apps
How Kris Writes Symfony AppsHow Kris Writes Symfony Apps
How Kris Writes Symfony Apps
 
jQuery (MeshU)
jQuery (MeshU)jQuery (MeshU)
jQuery (MeshU)
 
jQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and BlingjQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and Bling
 
The DOM is a Mess @ Yahoo
The DOM is a Mess @ YahooThe DOM is a Mess @ Yahoo
The DOM is a Mess @ Yahoo
 
jQuery in 15 minutes
jQuery in 15 minutesjQuery in 15 minutes
jQuery in 15 minutes
 
JavaScript 1.5 to 2.0 (TomTom)
JavaScript 1.5 to 2.0 (TomTom)JavaScript 1.5 to 2.0 (TomTom)
JavaScript 1.5 to 2.0 (TomTom)
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
 
Vue.js + Django - configuración para desarrollo con webpack y HMR
Vue.js + Django - configuración para desarrollo con webpack y HMRVue.js + Django - configuración para desarrollo con webpack y HMR
Vue.js + Django - configuración para desarrollo con webpack y HMR
 
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
 
How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0
 

Ähnlich wie HTML5: where flash isn't needed anymore

Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02
PL dream
 
How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1
Bitla Software
 
webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5
smueller_sandsmedia
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScripters
gerbille
 
JavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de DatosJavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de Datos
philogb
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
Igor Bronovskyy
 
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJSJavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
philogb
 
Cristiano Betta (Betta Works) - Lightweight Libraries with Rollup, Riot and R...
Cristiano Betta (Betta Works) - Lightweight Libraries with Rollup, Riot and R...Cristiano Betta (Betta Works) - Lightweight Libraries with Rollup, Riot and R...
Cristiano Betta (Betta Works) - Lightweight Libraries with Rollup, Riot and R...
Techsylvania
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
Patrick Lauke
 

Ähnlich wie HTML5: where flash isn't needed anymore (20)

Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02
 
Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?Google's HTML5 Work: what's next?
Google's HTML5 Work: what's next?
 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
 
How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1
 
Brave new world of HTML5
Brave new world of HTML5Brave new world of HTML5
Brave new world of HTML5
 
webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5webinale2011_Chris Mills_Brave new world of HTML5Html5
webinale2011_Chris Mills_Brave new world of HTML5Html5
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScripters
 
HTML5 and Other Modern Browser Game Tech
HTML5 and Other Modern Browser Game TechHTML5 and Other Modern Browser Game Tech
HTML5 and Other Modern Browser Game Tech
 
Augmented reality in web rtc browser
Augmented reality in web rtc browserAugmented reality in web rtc browser
Augmented reality in web rtc browser
 
JavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de DatosJavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de Datos
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJSJavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
 
Cristiano Betta (Betta Works) - Lightweight Libraries with Rollup, Riot and R...
Cristiano Betta (Betta Works) - Lightweight Libraries with Rollup, Riot and R...Cristiano Betta (Betta Works) - Lightweight Libraries with Rollup, Riot and R...
Cristiano Betta (Betta Works) - Lightweight Libraries with Rollup, Riot and R...
 
HTML5って必要?
HTML5って必要?HTML5って必要?
HTML5って必要?
 
I Can't Believe It's Not Flash
I Can't Believe It's Not FlashI Can't Believe It's Not Flash
I Can't Believe It's Not Flash
 
Moustamera
MoustameraMoustamera
Moustamera
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
 
A More Flash Like Web?
A More Flash Like Web?A More Flash Like Web?
A More Flash Like Web?
 

Mehr von Remy Sharp

jQuery: out with the old, in with the new
jQuery: out with the old, in with the newjQuery: out with the old, in with the new
jQuery: out with the old, in with the new
Remy Sharp
 
HTML5: huh, what is it good for?
HTML5: huh, what is it good for?HTML5: huh, what is it good for?
HTML5: huh, what is it good for?
Remy Sharp
 

Mehr von Remy Sharp (16)

Forget the Web
Forget the WebForget the Web
Forget the Web
 
Interaction Implementation
Interaction ImplementationInteraction Implementation
Interaction Implementation
 
jQuery: out with the old, in with the new
jQuery: out with the old, in with the newjQuery: out with the old, in with the new
jQuery: out with the old, in with the new
 
HTML5: huh, what is it good for?
HTML5: huh, what is it good for?HTML5: huh, what is it good for?
HTML5: huh, what is it good for?
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for Mobile
 
Webapps without the web
Webapps without the webWebapps without the web
Webapps without the web
 
TwitterLib.js
TwitterLib.jsTwitterLib.js
TwitterLib.js
 
HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?
 
codebits 2009 HTML5 JS APIs
codebits 2009 HTML5 JS APIscodebits 2009 HTML5 JS APIs
codebits 2009 HTML5 JS APIs
 
HTML5 JavaScript APIs
HTML5 JavaScript APIsHTML5 JavaScript APIs
HTML5 JavaScript APIs
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
 
HTML5 & Friends
HTML5 & FriendsHTML5 & Friends
HTML5 & Friends
 
HTML5 JS APIs
HTML5 JS APIsHTML5 JS APIs
HTML5 JS APIs
 
jQuery Loves Developers - SWDC2009
jQuery Loves Developers - SWDC2009jQuery Loves Developers - SWDC2009
jQuery Loves Developers - SWDC2009
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQuery
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

HTML5: where flash isn't needed anymore

  • 1. HTML5 vs. Flash Where Flash isn’t needed anymore
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. 1. video & Audio 2. Real-time 3. Graphics
  • 10.
  • 11. Who would jump to create another video player?
  • 12. IE9 & all others supported
  • 14. <!DOCTYPE html> <html lang="en"> <head> <meta charset=utf-8 /> <title>Video Example</title> </head> <body> <video src="dizzy.mp4" controls></video> </body> </html>
  • 15.
  • 16.
  • 18. <video controls> <source type="video/mp4" src="dizzy.mp4" codecs="avc1.42E01E, mp4a.40.2"> <source type="video/webm" src="dizzy.webm" codecs="vp8, vorbis"> <source type="video/ogg" src="dizzy.ogv" codecs="theora, vorbis"> </video>
  • 19. <video controls> <source type="video/mp4" src="dizzy.mp4"> <source type="video/webm" src="dizzy.webm"> <source type="video/ogg" src="dizzy.ogv"> </video>
  • 20. <video controls> <source src="dizzy.mp4"> <source src="dizzy.webm"> <source src="dizzy.ogv"> </video>
  • 21. <video controls> <source src="dizzy-hd.mp4" media="(min-device-height: 720px)"> <source src="dizzy-regular.mp4"> <...> </video>
  • 22. Video for Everybody <video width="640" height="360" poster="dizzy.jpg" controls> <source src="dizzy.mp4" type="video/mp4" /> <source src="dizzy.web" type="video/webm" /> <source src="dizzy.ogv" type="video/ogg" /><!--[if gt IE 6]> <object width="640" height="375" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"><! [endif]--><!--[if !IE]><!--> <object width="640" height="375" type="video/quicktime" data="dizzy.mp4"> <!--<![endif]--> <param name="src" value="dizzy.mp4" /> <param name="showlogo" value="false" /> <object width="640" height="380" type="application/x-shockwave-flash" data="player.swf?image=dizzy.jpg&amp;file=dizzy.mp4"> <param name="movie" value="player.swf?image=dizzy.jpg&amp;file=dizzy.mp4" /> <img src="dizzy.jpg" width="640" height="360" alt="Title of video" title="No video playback capabilities, please download the video below" /> </object><!--[if gt IE 6]><!--></object><!--<![endif]--> </video> <p>Download Video: <a href="dizzy.mp4">High Quality "MP4"</a> | <a href="dizzy.ogv">Low Quality "OGG"</a></p> http://camendesign.com/code/video_for_everybody
  • 24.
  • 25. var video = document.getElementById('myVideo'); if (video.paused) { video.play(); }
  • 26. var video = document.getElementById('myVideo'); if (video.paused) { video.play(); } // position & asTime defined elsewhere video.addEventListener('timeupdate', function () { positon.innerHTML = asTime(this.currentTime); }, false);
  • 27. Simple API Methods: play(), pause(), canPlayType(mime) Properties: currentTime, paused, duration, loop, autoplay, muted, volume, etc Events: loadedmetadata, canplay, progress, play, pause, seeking, timeupdate, etc
  • 28. Fullscreen? Warning! User agents should not provide a public API to cause videos to be shown full-screen. A script, combined with a carefully crafted video file, could trick the user into thinking a system-modal dialog had been shown, and prompt the user for a password. There is also the danger of "mere" annoyance, with pages launching full-screen videos when links are clicked or pages navigated. Instead, user-agent specific interface features may be provided to easily allow the user to obtain a full-screen playback mode.
  • 29.
  • 30.
  • 31. 1. No plugins required 2. Simple API: play, pause, etc 3. Video & Audio: the same 4. HTML & CSS - no compile or different skills required
  • 33. Flash will be needed as a backup to video for a while yet.
  • 35.
  • 36.
  • 37.
  • 39. WebSocket •Low latency • Bi-directional • No same-original rules • Chrome, Safari, MobileSafari & Firefox • Fallback on Flash...ironically
  • 40. WebSocket var ws = new WebSocket("ws://myserver.com/"); ws.onmessage = function (event) { var data = JSON.parse(event.data); }; ws.onclose = function () {}; ws.onopen = function () {};
  • 41. ws.onmessage = function (event) { var data = JSON.parse(event.data); }; All message data lives here
  • 42. EventSource •Server pushed events • Same-original rules apply • Can fallback with JavaScript
  • 43. EventSource var es = new EventSource("/x-service/"); es.onmessage = function (event) { var data = JSON.parse(event.data); }; es.onopen = function () {};
  • 47. HTML5 <canvas></canvas> var canvas = document.getElementsByTagName(‘canvas’)[0], ctx = canvas.getContext(‘2d’); 2D drawing API
  • 49.
  • 50. Google Analytics - Flash charts Interactive Demo - Canvas charts
  • 51.
  • 52.
  • 53.
  • 54. function canvas(w, h) { var ctx = document.createElement('canvas').getContext('2d'), canvas = ctx.canvas; canvas.width = w; canvas.height = h; return ctx; } var rainbow = canvas(100, 1), rainbowGrad = createRainbow(rainbow); rainbow.fillStyle = rainbowGrad; var imageData = rainbow.getImageData(0, 0, 100, 1), pixels = imageData.data; // loop over each pixel and create the dot image for (var i = 0; i < pixels.length; i += 4) { createPoint(pixels, i); }
  • 55. function createPoint(pixels, i) { // remove shadow var dot = canvas(24, 24); dot.shadowBlur = 0; dot.shadowColor = 'rgba(0,0,0,0)'; // outer white circle dot.fillStyle = '#fff'; dot.fillStyle = 'rgb(' + [ dot.arc(12, 12, 10, 0, Math.PI * 2, true); pixels[i], // red pixels[i+1], // green // drop shadow pixels[i+2] // blue dot.shadowBlur = 2; ].join(',') + ')'; dot.shadowColor = 'rgba(0,0,0,.7)'; dot.shadowOffsetX = 2; // start inner circle dot.shadowOffsetY = 2; dot.beginPath(); dot.arc(12, 12, 8, 0, Math.PI*2, true); // fill outer ring dot.fill(); // fill inner circle dot.fill(); new google.maps.MarkerImage( dot.canvas.toDataURL('image/png') ); }
  • 56. new google.maps.MarkerImage( dot.canvas.toDataURL('image/png') );
  • 57.
  • 58. 1. Timer paints video into canvas 2. Reads all pixels for bright spots 3. Translates to the vector 4. Draws selected input http://blog.mozbox.org/post/2009/04/12/Firefox-35%3A-a-new-experiment-with-Canvas-Video
  • 59. 1. Flash and canvas share the same black box features 2. People will abuse the technology
  • 61.
  • 64. 3D
  • 66. #canvas { -webkit-perspective: 800; -webkit-perspective-origin: 50% 20em; } #rubiks { -webkit-transform-style: preserve-3d; -webkit-transform: rotateX(15deg) rotat } #rubiks .face1 { -webkit-transform: rotateX(90deg) trans } #rubiks .face2 { /* front */ -webkit-transform: translateZ(10.8em); } #rubiks .face3 { -webkit-transform: rotateY(90deg) trans } #rubiks .face4 { /* back face */ -webkit-transform: rotateY(180deg) tran } #rubiks .face5 { -webkit-transform: rotateY(-90deg) tran
  • 67. WebGL
  • 68.
  • 69.
  • 71.
  • 72.
  • 73. ...or just ask a question :) - @rem