1,295
edits
Line 348: | Line 348: | ||
</script> | </script> | ||
11) Trigger a sound sample to be played through the effects graph in five seconds | |||
<script> | |||
var effectsMixer = ...; | |||
var audio = new Audio(...); | |||
function triggerSound() { | |||
var audio = new Audio(...); | |||
var stream = audio.captureStream(); | |||
stream.waitForUse = true; | |||
audio.play(); | |||
effectsMixer.addStream(stream, window.currentTime + 5); | |||
stream.onended = function() { effectsMixer.removeStream(stream); } | |||
} | |||
</script> | |||
12) Capture video from a camera and analyze it (e.g. face recognition) | |||
<script> | <script> | ||
Line 357: | Line 372: | ||
</script> | </script> | ||
13) Capture video, record it to a file and upload the file (e.g. Youtube) | |||
<script> | <script> | ||
Line 375: | Line 390: | ||
</script> | </script> | ||
14) Capture video from a canvas, record it to a file then upload | |||
<canvas width="640" height="480" id="c"></canvas> | <canvas width="640" height="480" id="c"></canvas> | ||
<script> | <script> | ||
var canvas = document.getElementById("c"); | var canvas = document.getElementById("c"); | ||
var streamRecorder = canvas. | var streamRecorder = canvas.stream.record(); | ||
function stopRecording() { | function stopRecording() { | ||
streamRecorder.getRecordedData(gotData); | streamRecorder.getRecordedData(gotData); |
edits