Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Combinando y grabando ⏺ video 🎥 y audio 🎙 en el...
Search
Lupo Montero
February 28, 2019
Programming
40
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Combinando y grabando ⏺ video 🎥 y audio 🎙 en el navegador
Mozilla Perú 28 Feb 2019
Lupo Montero
February 28, 2019
More Decks by Lupo Montero
See All by Lupo Montero
Trigonometría Bella
lupomontero
0
48
Analizadores sintácticos funcionales en JavaScript
lupomontero
0
110
Manejo de memoria en Rust: Ownership
lupomontero
0
49
Hola Rust! Aprendiendo con rustlings
lupomontero
1
350
WebThing: construyamos una lámpara 💡
lupomontero
1
100
Reduzco, reuso y reciclo
lupomontero
0
46
Web Assembly, Rust y el futuro de JavaScript
lupomontero
0
66
Primeros pasos con Rust y WebAssembly
lupomontero
0
560
Paralelizando promesas
lupomontero
0
370
Other Decks in Programming
See All in Programming
Press start. Python's next generation.
willingc
PRO
3
320
週末にAI-DLCを本気で回したら$1,600溶けた
hbashimizu
0
130
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.8k
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
510
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
5
1.3k
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
180
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.1k
PyO3 で既存 Python 評価器を Rust core 化する ー wasm-bindgen でブラウザにも配るための設計
kdash
1
560
業務時間外もAIに働いてもらう話
colorful12
3
10k
AIと壁打ちしながら進めるコスト管理
fufuhu
2
2k
AIの中の人になってみる
htkym
0
170
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
140
Featured
See All Featured
It's Worth the Effort
3n
188
29k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Balancing Empowerment & Direction
lara
6
1.3k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
240
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Git: the NoSQL Database
bkeepers
PRO
432
67k
How to Ace a Technical Interview
jacobian
281
24k
The Invisible Side of Design
smashingmag
301
52k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.3k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
380
Transcript
Combinando y grabando ⏺ video 🎥 y audio 🎙 en
el navegador @lupomontero - Mozilla Perú 28 Feb 2019
@Laboratoriala @LimaJSorg @NodeSchool @lupomontero @mozillaperu
WTF @!#$!! https://support.useloom.com/faqs-and-troubleshooting/general-faq/can-i-use-loo m-with-firefox-safari-etc
Estándares al rescate • MediaDevices • MediaStream • <video> •
<canvas> • Blob • ...
navigator.mediaDevices.getUserMedia navigator.mediaDevices.getUserMedia({ camera: { video: true }, }) .then((stream) =>
{ // `stream` is a `MediaStream` }) .catch(console.error);
MediaStream const track = stream.getVideoTracks()[0]; console.log(track.getSettings());
<video> const streamSettings = stream.getVideoTracks()[0].getSettings(); const video = document.createElement('video'); video.setAttribute('width',
streamSettings.width); video.setAttribute('height', streamSettings.height); video.srcObject = stream; video.play();
<canvas> const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); ctx.drawImage(
image, dx, dy, dWidth, dHeight, ); https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage
<canvas> const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); ctx.drawImage(
video, dx, dy, dWidth, dHeight, ); https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage
canvas.captureStream() const outputStream = new MediaStream(); const inputStreams = [audioStream,
canvas.captureStream()]; inputStreams.forEach( stream => stream.getTracks().forEach( track => outputStream.addTrack(track), ), );
window.requestAnimationFrame const update = () => { // redraw frame
... window.requestAnimationFrame(update); }; update();
MediaRecorder const recordedBlobs = []; const recorder = new MediaRecorder(outputStream,
{ mimeType: 'video/webm', }); recorder.addEventListener('dataavailable', (e) => { if (e.data && e.data.size > 0) { recordedBlobs.push(e.data); } }); recorder.start(1000);
Blob y window.URL recorder.stop(); const blob = new Blob(recordedBlobs, {
type: 'video/webm' }); const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.style.display = 'none'; a.href = url; a.download = 'test.webm'; document.body.appendChild(a); a.click(); setTimeout(() => { document.body.removeChild(a); window.URL.revokeObjectURL(url); }, 100);
Demo time!!!