SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
Capture vidéo avec
     HTML5
     #ParisJS — 25 Mai 2011
  Thomas Bassetto — @tbassetto
• HTML5 == buzzword         // true
• L’audio, une autre fois
Introduction
• Pourquoi ? Tchat, avatar, etc.
• ~ 3 specs + 10 implémentations
• Desktop, Mobile, Runtimes
• Flash le fait depuis au moins 2005
• “Débuts” en 2008 (Mozilla camera://,
  Google Gears)
W3C
DAP WG au W3C


• Device APIs and Policy Working Group
• HTML Media Capture + Media Capture API
HTML Media Capture

<input type="file" accept="image/*">
<input type="file" accept="image/*"
capture="camera">


capture = camera, camcorder,
          microphone, filesystem
Media Capture API

navigator.device.capture.capture
Image(success, error, { limit:
1 });
navigator.device.capture.support
edImageFormats;
Implémentations


• Android Stock Browser
• PhoneGap
Android

<input type="file" 
accept="image/
*;capture=camera">
</input>  
PhoneGap

navigator.device.capture.capture
Image(success, error, { limit:
1 });
navigator.device.capture.support
edImageModes;
WHATWG
HTML Living Standard

• Video conferencing and peer-to-peer
  communication
• Stream API
• PeerConnection
Code


window.navigator.getUserMedia
(options, successCallback [,
errorCallback ] );
Code
stream.label
stream.stop()
stream.audioTracks
stream.videoTracks
stream.getRecordedData(callback)
Code


window.URL.createObjectURL
(stream);
Implémentations


• Opera
• WebKit bientôt ?
WAC
Wholesale Applications
    Community

• OMPT BONDI + JIL => WAC
• ~ 50 membres : opérateurs et
  constructeurs
• WAC 1.0 et WAC 2.0
Code — WAC 1.0

Widget.Multimedia.Camera.capture
Image("/home/usr1/a.jpg",
false);
Widget.Multimedia.Camera.onCamer
aCaptured = myCallBack;
Code — WAC 2.0
var mainCamera;

var pendop = deviceapis.camera.getCameras
(onCamerasObtained, onGetCamerasError);

mainCamera = cams[0];

var op = mainCamera.captureImage(onCaptureImageSuccess,
onCaptureImageError, {destinationFilename:"images/
a.jpg", highRes:true});

// startVideoCapture()
Implémentations
WAC Spec Version     Runtime Vendor   Device OS

  WAC 2.0 beta           Aplix        Android 2.2+
WAC 1.0 & 2.0 beta       Borqs        Android 2.2+
    WAC 1.0              Obigo        Android 2.2x
WAC 1.0 & 2.0 beta       Opera        Android 2.1+
Ericsson Labs
Juste pour les yeux

• Travail sur WebKit
• 5 articles
• Aucun code ou binaire public
Code
<script>
window.onload = function () {
    var videoDevice = document.getElementById
("video_device");
    videoDevice.onchange = function (evt) {
         var videoStream = this.data;
         var video = document.getElementById("video");
         video.src = videoStream.url;
         video.play();
    };
} 
</script>
<device type="video_capture" id="video_device"></device> 
<video width="320" height="240" id="video" controls />
Code
var transceiver = new MediaStreamTransceiver("ws://
150.132.141.60:8880/delayswitch?sid=0");

// dans le onchange

transceiver.localStream = videoStream;

transceiver.onconnect = function () {
    var remoteVideo = document.getElementById
("remote_video");
    remoteVideo.src = transceiver.remoteStream.url;
    remoteVideo.play();
};
Mozilla
Rainbow

• Projet de Mozilla Labs
• API perso
• Extension disponible pour Firefox 4
• /! (sur Mac Firefox doit être lancé en 32-
  bit)
Code
window.navigator.media.beginSession(params, ctx, observer);

function observer(type, data)
{
    switch (type) {
        case "session-began": window.navigator.media.beginRecord();
break;
        case "record-began": break;
        case "record-ended": break;
        case "record-finished": break;
        case "session-ended": break;
    }
}

// endRecord() // fetchImage()
Démos


• https://photobooth.mozillalabs.com/
• https://theband.mozillalabs.com/theband.html
Les autres
En JavaScript aussi


• BlackBerry® WebWorks™
• Nokia WRT pour Symbian
Conclusion
“Il est probable que la Media Capture API s'aligne sur getUserMedia() de WHAT, ou
quelque chose du genre — c'est une question de priorité accordée par les
participants.

Au final, le W3C publiera forcément autour du stream, et ça sera en accord avec le
WHAT. Aussi, le W3C vient de lancer un groupe Real Time Web qui va traiter (avec
l'IETF) de beaucoup d'aspects du streaming.”

                                          — Un membre du DAP Working Group :)



Prédiction : Spécifications stabilisées et implémentations plus solides fin 2012, début
2013.

Contenu connexe

En vedette

Web Components & Shadow DOM
Web Components & Shadow DOMWeb Components & Shadow DOM
Web Components & Shadow DOMThomas Bassetto
 
Porting Flashblock to Jetpack Platform (draft)
Porting Flashblock to Jetpack Platform (draft)Porting Flashblock to Jetpack Platform (draft)
Porting Flashblock to Jetpack Platform (draft)Thomas Bassetto
 
Wicket Portlet Primer
Wicket Portlet PrimerWicket Portlet Primer
Wicket Portlet Primerate.douma
 
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...ate.douma
 
Claritas B A S E S Restaurant Audit Report
Claritas  B A S E S  Restaurant  Audit  ReportClaritas  B A S E S  Restaurant  Audit  Report
Claritas B A S E S Restaurant Audit Reportguest1f8179
 
Firefox 3.1 in 3.1 minutes
Firefox 3.1 in 3.1 minutesFirefox 3.1 in 3.1 minutes
Firefox 3.1 in 3.1 minutesThomas Bassetto
 
Athletic Comparisons
Athletic  ComparisonsAthletic  Comparisons
Athletic Comparisonsrlracette
 
NHTSA informational powerpoint
NHTSA informational powerpointNHTSA informational powerpoint
NHTSA informational powerpointkmfox
 
Premio World Press Photo 2.008
Premio World Press Photo 2.008Premio World Press Photo 2.008
Premio World Press Photo 2.008Roberto Cernuda
 
Web 2.0 e Social networking: cosa sono, chi li utilizza e chi ci guadagna die...
Web 2.0 e Social networking: cosa sono, chi li utilizza e chi ci guadagna die...Web 2.0 e Social networking: cosa sono, chi li utilizza e chi ci guadagna die...
Web 2.0 e Social networking: cosa sono, chi li utilizza e chi ci guadagna die...madero
 
Powerpoint Comp Skills Final One
Powerpoint Comp Skills Final OnePowerpoint Comp Skills Final One
Powerpoint Comp Skills Final Onelsmith7
 
poetry analysis
poetry analysispoetry analysis
poetry analysislsmith7
 
IRUDIEN TXOKOA
IRUDIEN TXOKOAIRUDIEN TXOKOA
IRUDIEN TXOKOAeukene
 
Calendario Asturias 2009
Calendario Asturias 2009Calendario Asturias 2009
Calendario Asturias 2009Roberto Cernuda
 
STORYTELLING 2010
STORYTELLING 2010STORYTELLING 2010
STORYTELLING 2010mtejederas1
 
Energia Alternativa e Utopie Energetiche
Energia Alternativa e Utopie EnergeticheEnergia Alternativa e Utopie Energetiche
Energia Alternativa e Utopie Energetichemadero
 

En vedette (20)

Ad
AdAd
Ad
 
Web Components & Shadow DOM
Web Components & Shadow DOMWeb Components & Shadow DOM
Web Components & Shadow DOM
 
Porting Flashblock to Jetpack Platform (draft)
Porting Flashblock to Jetpack Platform (draft)Porting Flashblock to Jetpack Platform (draft)
Porting Flashblock to Jetpack Platform (draft)
 
Wicket Portlet Primer
Wicket Portlet PrimerWicket Portlet Primer
Wicket Portlet Primer
 
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
 
Claritas B A S E S Restaurant Audit Report
Claritas  B A S E S  Restaurant  Audit  ReportClaritas  B A S E S  Restaurant  Audit  Report
Claritas B A S E S Restaurant Audit Report
 
Firefox 3.1 in 3.1 minutes
Firefox 3.1 in 3.1 minutesFirefox 3.1 in 3.1 minutes
Firefox 3.1 in 3.1 minutes
 
Athletic Comparisons
Athletic  ComparisonsAthletic  Comparisons
Athletic Comparisons
 
NHTSA informational powerpoint
NHTSA informational powerpointNHTSA informational powerpoint
NHTSA informational powerpoint
 
Ppt Netvibes
Ppt NetvibesPpt Netvibes
Ppt Netvibes
 
Premio World Press Photo 2.008
Premio World Press Photo 2.008Premio World Press Photo 2.008
Premio World Press Photo 2.008
 
Web 2.0 e Social networking: cosa sono, chi li utilizza e chi ci guadagna die...
Web 2.0 e Social networking: cosa sono, chi li utilizza e chi ci guadagna die...Web 2.0 e Social networking: cosa sono, chi li utilizza e chi ci guadagna die...
Web 2.0 e Social networking: cosa sono, chi li utilizza e chi ci guadagna die...
 
Powerpoint Comp Skills Final One
Powerpoint Comp Skills Final OnePowerpoint Comp Skills Final One
Powerpoint Comp Skills Final One
 
poetry analysis
poetry analysispoetry analysis
poetry analysis
 
Crystal Pole
Crystal PoleCrystal Pole
Crystal Pole
 
IRUDIEN TXOKOA
IRUDIEN TXOKOAIRUDIEN TXOKOA
IRUDIEN TXOKOA
 
Ottieni più risultati dal tuo sito web - Joomlday 2014
Ottieni più risultati dal tuo sito web - Joomlday 2014Ottieni più risultati dal tuo sito web - Joomlday 2014
Ottieni più risultati dal tuo sito web - Joomlday 2014
 
Calendario Asturias 2009
Calendario Asturias 2009Calendario Asturias 2009
Calendario Asturias 2009
 
STORYTELLING 2010
STORYTELLING 2010STORYTELLING 2010
STORYTELLING 2010
 
Energia Alternativa e Utopie Energetiche
Energia Alternativa e Utopie EnergeticheEnergia Alternativa e Utopie Energetiche
Energia Alternativa e Utopie Energetiche
 

Similaire à [FR] Capture vidéo avec HTML5

L'Open Web en tant que pierre angulaire du développement multi-objets
L'Open Web en tant que pierre angulaire du développement multi-objetsL'Open Web en tant que pierre angulaire du développement multi-objets
L'Open Web en tant que pierre angulaire du développement multi-objetsThomas Bassetto
 
HTML5... La révolution maintenant!
HTML5... La révolution maintenant!HTML5... La révolution maintenant!
HTML5... La révolution maintenant!CARA_Lyon
 
HTML5... La révolution maintenant!
HTML5... La révolution maintenant!HTML5... La révolution maintenant!
HTML5... La révolution maintenant!CARA_Lyon
 
Introduction to WebRTC on iOS
Introduction to WebRTC on iOSIntroduction to WebRTC on iOS
Introduction to WebRTC on iOSCocoaHeads France
 
La mobilité dans Drupal
La mobilité dans DrupalLa mobilité dans Drupal
La mobilité dans DrupalAdyax
 
Codedarmor 2012 - 06/03 - HTML5, CSS3 et Javascript
Codedarmor 2012 - 06/03 - HTML5, CSS3 et JavascriptCodedarmor 2012 - 06/03 - HTML5, CSS3 et Javascript
Codedarmor 2012 - 06/03 - HTML5, CSS3 et Javascriptcodedarmor
 
[AzureCamp 24 Juin 2014] Interactions en "temps réel" pour les applications W...
[AzureCamp 24 Juin 2014] Interactions en "temps réel" pour les applications W...[AzureCamp 24 Juin 2014] Interactions en "temps réel" pour les applications W...
[AzureCamp 24 Juin 2014] Interactions en "temps réel" pour les applications W...Microsoft Technet France
 
Mise en bouche a html5
Mise en bouche a html5Mise en bouche a html5
Mise en bouche a html5laurentt
 
GWT Approfondissement - GTI780 & MTI780 - ETS - A09
GWT Approfondissement  - GTI780 & MTI780 - ETS - A09GWT Approfondissement  - GTI780 & MTI780 - ETS - A09
GWT Approfondissement - GTI780 & MTI780 - ETS - A09Claude Coulombe
 
Introduction à web assembly
Introduction à web assemblyIntroduction à web assembly
Introduction à web assemblyJérémy Buget
 
Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...
Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...
Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...Jean-Laurent de Morlhon
 
Java dans Windows Azure: l'exemple de Jonas
Java dans Windows Azure: l'exemple de JonasJava dans Windows Azure: l'exemple de Jonas
Java dans Windows Azure: l'exemple de JonasMicrosoft
 
HTML5 et Internet Explorer 9, est-ce réellement compatible?
HTML5 et Internet Explorer 9, est-ce réellement compatible?HTML5 et Internet Explorer 9, est-ce réellement compatible?
HTML5 et Internet Explorer 9, est-ce réellement compatible?Frédéric Harper
 
HTML5 W3C Conference Euratechnologie
HTML5 W3C Conference EuratechnologieHTML5 W3C Conference Euratechnologie
HTML5 W3C Conference Euratechnologiewyggio
 
Présentation Wakanda @ JSRomandie
Présentation Wakanda @ JSRomandiePrésentation Wakanda @ JSRomandie
Présentation Wakanda @ JSRomandieGabriel Inzirillo
 
Presentation of GWT 2.4 (PowerPoint version)
Presentation of GWT 2.4 (PowerPoint version)Presentation of GWT 2.4 (PowerPoint version)
Presentation of GWT 2.4 (PowerPoint version)Celinio Fernandes
 
Les défis d’une application mobile multi-périphériques avec HTML5
Les défis d’une application mobile multi-périphériques avec HTML5Les défis d’une application mobile multi-périphériques avec HTML5
Les défis d’une application mobile multi-périphériques avec HTML5davrous
 
Firefox OS, le web de demain - Epita - 2014-06-06
Firefox OS, le web de demain - Epita - 2014-06-06Firefox OS, le web de demain - Epita - 2014-06-06
Firefox OS, le web de demain - Epita - 2014-06-06Frédéric Harper
 

Similaire à [FR] Capture vidéo avec HTML5 (20)

L'Open Web en tant que pierre angulaire du développement multi-objets
L'Open Web en tant que pierre angulaire du développement multi-objetsL'Open Web en tant que pierre angulaire du développement multi-objets
L'Open Web en tant que pierre angulaire du développement multi-objets
 
HTML5... La révolution maintenant!
HTML5... La révolution maintenant!HTML5... La révolution maintenant!
HTML5... La révolution maintenant!
 
HTML5... La révolution maintenant!
HTML5... La révolution maintenant!HTML5... La révolution maintenant!
HTML5... La révolution maintenant!
 
Nouveaux apis
Nouveaux apisNouveaux apis
Nouveaux apis
 
Introduction to WebRTC on iOS
Introduction to WebRTC on iOSIntroduction to WebRTC on iOS
Introduction to WebRTC on iOS
 
La mobilité dans Drupal
La mobilité dans DrupalLa mobilité dans Drupal
La mobilité dans Drupal
 
Codedarmor 2012 - 06/03 - HTML5, CSS3 et Javascript
Codedarmor 2012 - 06/03 - HTML5, CSS3 et JavascriptCodedarmor 2012 - 06/03 - HTML5, CSS3 et Javascript
Codedarmor 2012 - 06/03 - HTML5, CSS3 et Javascript
 
[AzureCamp 24 Juin 2014] Interactions en "temps réel" pour les applications W...
[AzureCamp 24 Juin 2014] Interactions en "temps réel" pour les applications W...[AzureCamp 24 Juin 2014] Interactions en "temps réel" pour les applications W...
[AzureCamp 24 Juin 2014] Interactions en "temps réel" pour les applications W...
 
Mise en bouche a html5
Mise en bouche a html5Mise en bouche a html5
Mise en bouche a html5
 
GWT Approfondissement - GTI780 & MTI780 - ETS - A09
GWT Approfondissement  - GTI780 & MTI780 - ETS - A09GWT Approfondissement  - GTI780 & MTI780 - ETS - A09
GWT Approfondissement - GTI780 & MTI780 - ETS - A09
 
Introduction à web assembly
Introduction à web assemblyIntroduction à web assembly
Introduction à web assembly
 
Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...
Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...
Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...
 
Java dans Windows Azure: l'exemple de Jonas
Java dans Windows Azure: l'exemple de JonasJava dans Windows Azure: l'exemple de Jonas
Java dans Windows Azure: l'exemple de Jonas
 
HTML5 et Internet Explorer 9, est-ce réellement compatible?
HTML5 et Internet Explorer 9, est-ce réellement compatible?HTML5 et Internet Explorer 9, est-ce réellement compatible?
HTML5 et Internet Explorer 9, est-ce réellement compatible?
 
HTML5 en projet
HTML5 en projetHTML5 en projet
HTML5 en projet
 
HTML5 W3C Conference Euratechnologie
HTML5 W3C Conference EuratechnologieHTML5 W3C Conference Euratechnologie
HTML5 W3C Conference Euratechnologie
 
Présentation Wakanda @ JSRomandie
Présentation Wakanda @ JSRomandiePrésentation Wakanda @ JSRomandie
Présentation Wakanda @ JSRomandie
 
Presentation of GWT 2.4 (PowerPoint version)
Presentation of GWT 2.4 (PowerPoint version)Presentation of GWT 2.4 (PowerPoint version)
Presentation of GWT 2.4 (PowerPoint version)
 
Les défis d’une application mobile multi-périphériques avec HTML5
Les défis d’une application mobile multi-périphériques avec HTML5Les défis d’une application mobile multi-périphériques avec HTML5
Les défis d’une application mobile multi-périphériques avec HTML5
 
Firefox OS, le web de demain - Epita - 2014-06-06
Firefox OS, le web de demain - Epita - 2014-06-06Firefox OS, le web de demain - Epita - 2014-06-06
Firefox OS, le web de demain - Epita - 2014-06-06
 

[FR] Capture vidéo avec HTML5