01 <script>
02 		// Event erstellen
03 window.addEventListener("DOMContentLoaded", function()
04 {
05     // Variabeln
06     var canvas = document.getElementById('canvas');
07     var context = canvas.getContext('2d');
08     var video = document.getElementById('video');
09     var mediaConfig =  { video: true };
10     var errBack = function(e)
11     {
12         alert('Fehler', e)
13     };
14     // Video Event erstellen
15     if(navigator.mediaDevices || navigator.mediaDevices.getUserMedia)
16     {
17         navigator.mediaDevices.getUserMedia(mediaConfig).then
18         (function(stream)
19         {
20             var video = document.querySelector('video');
21             video.srcObject = stream;
22             video.onloadedmetadata = function(e)
23             {
24                 video.src = window.webkitURL.createObjectURL(stream);
25                 video.play();
26             };
27         }
28         );
29     }
53 </script>