forked from shower/shower
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
848 lines (719 loc) · 23.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
<!DOCTYPE html>
<html lang="en">
<head>
<title>Playful webcam</title>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="node_modules/shower-ribbon/styles/screen-16x10.css">
<link rel="stylesheet" href="assets/styles/custom.css">
</head>
<body class="shower list">
<header class="caption">
<h1>Playful webcam</h1>
<p>
<a href="https://zmoki.github.io/">Zarema Khalilova</a>, <a href="https://realadvisor.com/">RealAdvisor</a>
</p>
</header>
<section class="slide black" id="cover">
<h2>Playful webcam</h2>
<p>by Zarema Khalilova</p>
<style>
#cover {
text-align: center;
}
#cover h2 {
margin: 100px 0 0;
text-align: center;
font-size: 90px;
}
#cover p {
margin: 10px 0 20px;
font-style: italic;
font-size: 40px;
}
</style>
</section>
<section class="slide black" id="spb">
<h2 class="shout shout-over">I'm from Saint-Petersburg, Russia</h2>
<img src="./pictures/spb.png" alt="" class="cover">
</section>
<section class="slide black" id="spb-frontend">
<h2 class="shout shout-over">I'm founder of the community</h2>
<img src="./pictures/spb-frontend.jpg" alt="SPB Frontend" class="cover">
<style>
#spb-frontend .shout {
top: calc(50% - 180px);
}
</style>
</section>
<section class="slide black" id="realadvisor">
<h2 class="shout shout-over">currently working with RealAdvisor</h2>
<img src="./pictures/realadvisor.png" alt="" class="cover">
</section>
<section class="slide black" id="uploadcare" style="text-align: center;">
<h2>previously worked with</br>
<img src="./pictures/uploadcare.svg"
height="auto" alt="Uploadcare"></h2>
<figure>
<video height="350" autoplay loop muted webkit-playsinline playsinline>
<source src="https://ucarecdn.com/7e891678-8a9b-4284-9e4c-b61bc1cf860a/gif2video/-/format/webm/widget.gif" type="video/webm">
<source src="https://ucarecdn.com/7e891678-8a9b-4284-9e4c-b61bc1cf860a/gif2video/-/format/mp4/widget.gif" type="video/mp4">
</video>
<figcaption class="vertical-caption">
Uploadcare Widget ↑
</figcaption>
</figure>
</section>
<section class="slide black" style="text-align: center;" id="u-webcam-tab">
<figure>
<video height="440" autoplay loop muted webkit-playsinline playsinline>
<source src="https://ucarecdn.com/060064d9-4210-4c81-9c34-c607a4e8805c/gif2video/-/format/webm/camera-tab.gif" type="video/webm">
<source src="https://ucarecdn.com/060064d9-4210-4c81-9c34-c607a4e8805c/gif2video/-/format/mp4/camera-tab.gif" type="video/mp4">
</video>
<figcaption class="vertical-caption">Webcam source tab ↑</figcaption>
</figure>
<style>
#u-webcam-tab .vertical-caption {
left: -8%;
}
</style>
</section>
<section class="slide black">
<h2 class="shout" style="font-size: 80px;">Media Capture and Stream API</h2>
</section>
<section class="slide black">
<h2 class="shout">Stream</h2>
</section>
<section class="slide black">
<h2>Get stream</h2>
<pre>
<code>const constraints = {video: true, audio: true}</code>
<code> </code>
<code>navigator.mediaDevices.<mark>getUserMedia</mark>(constraints)</code>
<code> .then(<mark>stream</mark> => {...})</code>
<code> .catch(error => {...})</code>
</pre>
</section>
<section class="slide black">
<h2>Stream to video element</h2>
<pre>
<code>stream => {</code>
<code class="mark"> const $video = document.querySelector('video')</code>
<code> </code>
<code> $video<mark>.srcObject = stream</mark></code>
<code> $video<mark>.onloadedmetadata</mark> = () => $video<mark>.play()</mark></code>
<code>}</code>
</pre>
</section>
<section class="slide black" id="demo-stream">
<div class="demo-preview place">
<h2>Demo: Stream to video element</h2>
<p>Choose this slide to see demo</p>
</div>
<video class="demo-video place" hidden></video>
<p class="demo-error place" hidden></p>
<script src="assets/scripts/demo-stream.js" async></script>
</section>
<section class="slide black">
<h2>Stream to canvas</h2>
<pre>
<code>stream => {</code>
<code class="mark"> const $video = document.createElement('video')</code>
<code> </code>
<code> $video.srcObject = stream</code>
<code> $video.onloadedmetadata = () => {</code>
<code> $video.play()</code>
<code class="comment"> ...</code>
</pre>
</section>
<section class="slide black">
<h2>Stream to canvas</h2>
<pre>
<code class="comment"> ...</code>
<code class="mark"> const $canvas = document.querySelector('canvas')</code>
<code> </code>
<code> $<mark>canvas.width</mark> = $<mark>video.videoWidth</mark></code>
<code> $canvas.height = $video.videoHeight</code>
<code class="comment"> ...</code>
</pre>
</section>
<section class="slide black">
<h2>Stream to canvas</h2>
<pre>
<code class="comment"> ...</code>
<code> const context = $<mark>canvas.getContext('2d')</mark></code>
<code> </code>
<code> const draw = () => {</code>
<code> context.<mark>drawImage</mark>($<mark>video</mark>, 0, 0)</code>
<code> requestAnimationFrame(draw)</code>
<code> }</code>
<code class="comment"> ...</code>
</pre>
</section>
<section class="slide black">
<h2>Stream to canvas</h2>
<pre>
<code class="comment"> ...</code>
<code> <mark>requestAnimationFrame(draw)</mark></code>
<code> }</code>
<code>}</code>
</pre>
</section>
<section class="slide black" id="demo-canvas">
<div class="demo-preview place">
<h2>Demo: Stream to canvas</h2>
<p>Choose this slide to see demo</p>
</div>
<canvas class="demo-canvas place" hidden></canvas>
<p class="demo-error place" hidden></p>
<script src="assets/scripts/demo-canvas.js" async></script>
</section>
<section class="slide black" id="demo-canvas-text">
<div class="demo-preview place">
<h2>Demo: Stream to canvas</h2>
<p>Choose this slide to see demo</p>
</div>
<canvas class="demo-canvas place" hidden></canvas>
<p class="demo-error place" hidden></p>
</section>
<section class="slide black" id="demo-canvas-image">
<div class="demo-preview place">
<h2>Demo: Stream to canvas</h2>
<p>Choose this slide to see demo</p>
</div>
<canvas class="demo-canvas place" hidden></canvas>
<p class="demo-error place" hidden></p>
</section>
<section class="slide black">
<h2>Stream to canvas</h2>
<h3>Performance problems:</h3>
<ol>
<li>frequency of <code>drawImage</code> calls is higher than the frame rate of the video</li>
<li class="next">the more pixels, the more resource-intensive it gets</li>
</ol>
</section>
<section class="slide black canvas-perf black">
<h2 class="place bottom">1280px video to canvas</h2>
<img class="cover" src="https://ucarecdn.com/73181fce-18e6-40bb-98da-a9df8460df83/-/crop/2100x1313/0,50/-/resize/1024x/" alt="">
</section>
<section class="slide black">
<h2>Stream to canvas</h2>
<h3>Solution of performance problems:</h3>
<pre>
<code>let frameDrawed = true</code>
<code>const runDraw = () => {</code>
<code> if (!frameDrawed) return</code>
<code> frameDrawed = false</code>
<code> requestAnimationFrame(draw)</code>
<code>}</code>
</pre>
</section>
<section class="slide black">
<h2>Stream to canvas</h2>
<h3>Solution of performance problems:</h3>
<pre>
<code>const streamTrack = stream.getVideoTracks()[0]</code>
<code>const {frameRate} = streamTrack.getSettings()</code>
<code>const delay = 1000 / frameRate</code>
<code> </code>
<code>let frameInterval = setInterval(runDraw, delay)</code>
</pre>
</section>
<section class="slide black">
<h2>Stream to canvas</h2>
<h3>Solution of performance problems:</h3>
<pre>
<code>const draw = () => {</code>
<code class="comment"> ...</code>
<code> <s>requestAnimationFrame(draw)</s></code>
<code> frameDrawed = true</code>
<code>}</code>
</pre>
</section>
<section class="slide black canvas-perf">
<h2 class="place bottom">1280px video to canvas</h2>
<h3 class="place">requestAnimationFrame <span class="heart">❤</span> setInterval</h3>
<img class="cover" src="https://ucarecdn.com/db2eb183-8038-445e-a411-f4c1ea2195a4/-/crop/2100x1313/0,50/-/resize/1024x/" alt="">
</section>
<section class="slide black">
<h2>Constraints</h2>
</section>
<section class="slide black">
<h2>Constraints</h2>
<pre>
<code><mark>const constraints = {video: true, audio: true}</mark></code>
<code> </code>
<code>navigator.mediaDevices.getUserMedia(constraints)</code>
<code> .then(stream => {...})</code>
<code> .catch(error => {...})</code>
</pre>
</section>
<section class="slide black">
<h2>Supported constraints</h2>
<pre>
<code>const supportedConstraints =</code>
<code> navigator.mediaDevices.<mark>getSupportedConstraints</mark>()</code>
</pre>
</section>
<section class="slide black" id="demo-supported-constraints">
<h2>Demo: Supported constraints</h2>
<ul class="demo-output double"></ul>
<style>
#demo-supported-constraints .demo-output {
font-size: 70%;
column-count: 3;
}
</style>
<script src="assets/scripts/demo-supported-constraints.js" async></script>
</section>
<section class="slide black">
<h2>Video constraints</h2>
<pre>
<code>const constraints = {</code>
<code> video: {</code>
<code> <mark>height</mark>: 200,</code>
<code> <mark>aspectRatio</mark>: 1,</code>
<code> },</code>
<code>}</code>
<code> </code>
<code>navigator.mediaDevices.getUserMedia(constraints)</code>
</pre>
</section>
<section class="slide black" id="demo-constraints">
<div class="demo-preview place">
<h2>Demo: Video constraints</h2>
<p>Choose this slide to see demo</p>
</div>
<video class="demo-video place" hidden></video>
<p class="demo-error place" hidden></p>
<script src="assets/scripts/demo-constraints.js" async></script>
</section>
<section class="slide black">
<h2>Capabilities</h2>
</section>
<section class="slide black">
<h2>Capabilities</h2>
<pre>
<code>const videoTrack = stream<mark>.getVideoTracks()[0]</mark></code>
<code>const capabilities = videoTrack<mark>.getCapabilities()</mark></code>
<code> </code>
<code>if (Object.keys(capabilities).length) {</code>
<code> <span class="comment">// You can configure stream</span></code>
<code>}</code>
</pre>
</section>
<section class="slide black">
<h2>Capabilities: torch</h2>
<pre>
<code><mark>if (capabilities.torch)</mark> {</code>
<code> const $torch = document.querySelector('button.torch')</code>
<code> $torch.onclick = () => {</code>
<code> const torch = (videoTrack<mark>.getSettings()</mark>).torch</code>
<code> videoTrack<mark>.applyConstraints</mark>({</code>
<code> <mark>advanced</mark>: [{torch: !currentTorch}]</code>
<code> })</code>
</pre>
</section>
<section class="slide black">
<h2>Capabilities: zoom</h2>
<pre>
<code><mark>if (capabilities.zoom)</mark> {</code>
<code> const $zoom = document.querySelector('<mark>input[type=range]</mark>')</code>
<code> </code>
<code> $zoom.min = capabilities.zoom.min</code>
<code> $zoom.max = capabilities.zoom.max</code>
<code> $zoom.step = capabilities.zoom.step</code>
<code class="comment"> ...</code>
</pre>
</section>
<section class="slide black">
<h2>Capabilities: zoom</h2>
<pre>
<code class="comment"> ...</code>
<code> $zoom.value = (videoTrack.getSettings()).zoom</code>
<code> </code>
<code> $zoom.onchange = (e) => videoTrack.applyConstraints({</code>
<code> advanced: [{zoom: e.target.value}]</code>
<code> })</code>
</pre>
</section>
<section class="slide black" id="demo-settings">
<div class="demo-preview place">
<h2>Demo: Capabilities</h2>
<p>Choose this slide to see demo</p>
</div>
<video class="demo-video place" hidden></video>
<p class="demo-error place" hidden></p>
<mark class="demo-notice place" hidden></mark>
<button type="button" class="demo-torch place top" hidden>Torch on/off</button>
<input type="range" class="demo-zoom place bottom" hidden>
<script src="assets/scripts/demo-settings.js" async></script>
<style>
.demo-notice {
width: 80%;
text-align: center;
opacity: 0.8;
}
.demo-controls {
padding: 40px;
}
.demo-torch {
font-size: 120%;
padding: 20px;
margin-top: 40px;
}
.demo-zoom {
margin-bottom: 80px;
}
</style>
</section>
<section class="slide black">
<h2 class="shout">Take photo</h2>
</section>
<section class="slide black">
<h2>Tip: save blob to image</h2>
<pre>
<code>const blobToImage = blob => {</code>
<code> const $img = document.createElement('img')</code>
<code> </code>
<code> $img.src = <mark>URL.createObjectURL(blob)</mark></code>
<code> $img.onload = () => URL.revokeObjectURL($img.src)</code>
<code> </code>
<code> document.querySelector('.output').append($img)</code>
<code>}</code>
</pre>
</section>
<section class="slide black">
<h2>Take photo</h2>
<div class="place">
<h2>Way #1: <code>canvas</code> & <code>drawImage</code></h2>
<p>Grab <b>video</b> frame</p>
</div>
</section>
<section class="slide black">
<h2>Take photo: <code>drawImage</code></h2>
<pre>
<code>stream => {</code>
<code class="comment"> ... <span class="comment">// Get video element and put stream to that</span></code>
<code class="comment"> ... <span class="comment">// Create canvas and context</span></code>
<code> context.<mark>drawImage</mark>($video, 0, 0)</code>
<code class="comment"> ...</code>
</pre>
</section>
<section class="slide black">
<h2>Take photo: <code>drawImage</code></h2>
<pre>
<code class="comment"> ...</code>
<code> $canvas.<mark>toBlob</mark>(blob => blobToImage(blob))</code>
<code>}</code>
</pre>
</section>
<section class="slide black">
<h2>Take photo</h2>
<div class="place">
<h2>Way #2: <code>ImageCapture</code> & <code>grabFrame</code></h2>
<p>Grab <b>stream</b> frame</p>
</div>
</section>
<section class="slide black">
<h2>Take photo: <code>grabFrame</code></h2>
<pre>
<code>stream => {</code>
<code> const streamTrack = stream.getVideoTracks()[0]</code>
<code> const imageCapture = new <mark>ImageCapture</mark>(streamTrack)</code>
<code class="comment"> ...</code>
</pre>
</section>
<section class="slide black">
<h2>Take photo: <code>grabFrame</code></h2>
<pre>
<code class="comment"> ...</code>
<code> imageCapture.<mark>grabFrame</mark>()</code>
<code> .then(imageBitmap => {</code>
<code class="comment"> ... <span class="comment">// Create canvas and context</span></code>
<code> context.drawImage(imageBitmap, 0, 0)</code>
<code> $canvas.toBlob(blob => blobToImage(blob))</code>
<code> }</code>
<code>}</code>
</pre>
</section>
<section class="slide black">
<h2>Take photo</h2>
<div class="place">
<h2>Way #3: <code>ImageCapture</code> & <code>takePhoto</code></h2>
<p>Get full resolution photo from <b>stream</b></p>
</div>
</section>
<section class="slide black">
<h2>Take photo: <code>takePhoto</code></h2>
<pre>
<code class="comment"> ...</code>
<code> imageCapture.<mark>takePhoto</mark>()</code>
<code> .then(blob => blobToImage(blob))</code>
<code>}</code>
</pre>
</section>
<section class="slide black" id="demo-photos">
<div class="demo-preview place">
<h2>Demo: Take photo</h2>
<p>Choose this slide to see demo</p>
</div>
<div class="demo-output place">
<video class="demo-video" hidden></video>
<div class="demo-output-result"></div>
</div>
<p class="demo-error place" hidden></p>
<style>
#demo-photos .demo-output {
max-width: 100%;
max-height: 100%;
overflow: scroll;
}
#demo-photos .demo-output-result {
width: 90%;
display: flex;
justify-content: flex-start;
align-items: flex-start;
flex-direction: column;
}
#demo-photos .demo-img-wrap {
position: relative;
}
#demo-photos .demo-img-wrap::after {
content: attr(title);
display: block;
width: 100%;
height: 40px;
background: rgba(0, 0, 0, 0.5);
position: absolute;
top: 0;
left: 0;
}
</style>
<script src="assets/scripts/demo-photos.js" async></script>
</section>
<section class="slide black">
<h2 class="shout">Record</h2>
</section>
<section class="slide black" id="demo-record">
<div class="demo-preview place">
<h2>Demo: Record stream</h2>
<p>Choose this slide to see demo</p>
</div>
<div class="demo-controls place top" hidden>
<button class="demo-control demo-control_start" type="button">Start record</button>
<button class="demo-control demo-control_stop" type="button" hidden>Stop record</button>
</div>
<video class="demo-video place" hidden></video>
<div class="place demo-output"></div>
<p class="demo-error place" hidden></p>
<script src="assets/scripts/demo-record.js" async></script>
</section>
<section class="slide black">
<h2>Record stream</h2>
<pre>
<code>stream => {</code>
<code class="comment"> ... <span class="comment">// Create video and put stream to video</span></code>
<code> let <mark>chunks = []</mark></code>
<code> const mediaRecorder = new <mark>MediaRecorder</mark>(stream)</code>
<code class="comment"> ...</code>
</pre>
</section>
<section class="slide black">
<h2>Record stream</h2>
<pre>
<code class="comment"> ...</code>
<code> $startButton.onclick = () => mediaRecorder.start()</code>
<code> $stopButton.onclick = () => mediaRecorder.stop()</code>
<code class="comment"> ...</code>
</pre>
</section>
<section class="slide black">
<h2>Record stream</h2>
<pre>
<code class="comment"> ...</code>
<code> mediaRecorder.<mark>ondataavailable</mark> = (e) => <mark>chunks.push</mark>(e.data)</code>
<code> </code>
<code> mediaRecorder.<mark>onstop</mark> = () =></code>
<code> blobToVideo(new Blob(chunks, {type: '<mark>video/webm</mark>'}))</code>
<code>}</code>
</pre>
</section>
<section class="slide black">
<h2 class="shout shrink">Let's fun</h2>
</section>
<section class="slide black">
<h2>Filters</h2>
</section>
<section class="slide black" id="demo-filters">
<div class="demo-preview place">
<h2>Demo: Filters</h2>
<p>Choose this slide to see demo</p>
</div>
<div class="demo-controls place top" hidden>
<button type="button" class="demo-control" data-filter="original">Original</button>
<button type="button" class="demo-control" data-filter="grayscale">Grayscale</button>
<button type="button" class="demo-control" data-filter="invert">Invert</button>
<button type="button" class="demo-control" data-filter="Toaster">Instagram: Toaster</button>
<button type="button" class="demo-take-photo">Take photo</button>
</div>
<video class="demo-video place" data-filter="original" hidden></video>
<div class="demo-output place"></div>
<p class="demo-error place" hidden></p>
<style>
#demo-filters video[data-filter=original] {
filter: none;
}
#demo-filters video[data-filter=grayscale] {
filter: grayscale(100%);
}
#demo-filters video[data-filter=invert] {
filter: invert(100%);
}
#demo-filters video[data-filter=Toaster] {
filter: sepia(0.4) saturate(2.5) hue-rotate(-30deg) contrast(0.67);
}
</style>
<script src="assets/scripts/demo-filters.js" async></script>
</section>
<section class="slide black">
<h2>Filters</h2>
<p>Just use <b>CSS Filters</b> for video</p>
<pre>
<code>video[data-filter=grayscale] {</code>
<code> filter: grayscale(100%);</code>
<code>}</code>
</pre>
</section>
<section class="slide black">
<h2>Filters</h2>
<p>To take photo with filter use <code>drawImage</code> way with tip:</p>
<pre>
<code>context.filter = window</code>
<code> .getComputedStyle($video, null)</code>
<code> .getPropertyValue('filter')</code>
<code> </code>
<code>context.drawImage($video, 0, 0)</code>
</pre>
</section>
<section class="slide black">
<h2>ASCII Video Stream</h2>
</section>
<section class="slide black" id="demo-ascii">
<p id="ascii-info">Please allow this page to access your camera.</p>
<div id="ascii-notSupported">
<p>Your browser does not support the Camera API.</p>
</div>
<pre id="ascii-stream" class="place"></pre>
<button id="ascii-button">start</button>
<script src="assets/scripts/ascii/camera.js"></script>
<script src="assets/scripts/ascii/ascii.js"></script>
<script src="assets/scripts/ascii/app.js"></script>
<style>
#ascii-notSupported, #ascii-button {
display: none;
}
#ascii-stream {
font-family: 'Courier New', 'Courier', monospace;
font-size: 10px;
line-height: 10px;
letter-spacing: -1.5px;
text-align: center;
}
</style>
</section>
<section class="slide black">
<h2>Face mask</h2>
</section>
<section class="slide black" id="demo-mask">
<div class="demo-preview place">
<h2>Demo: Face mask</h2>
<p>Choose this slide to see demo</p>
</div>
<video class="demo-video place" width="640" height="480" preload autoplay loop muted hidden></video>
<canvas class="demo-canvas place" width="640" height="480" hidden></canvas>
<p class="demo-error place" hidden></p>
<script src="assets/scripts/tracking/tracking-min.js" async></script>
<script src="assets/scripts/tracking/face-min.js" async></script>
<script src="assets/scripts/demo-mask.js" async></script>
</section>
<section class="slide black">
<h2>Face mask</h2>
<ul>
<li>
<a href="https://blog.arnellebalane.com/introduction-to-the-shape-detection-api-e07425396861">
Shape Detection API
</a>
</li>
<li>
<a href="https://trackingjs.com/">tracking.js</a>
</li>
</ul>
</section>
<section class="slide black">
<h2>Augmented reality</h2>
</section>
<section class="slide black" id="demo-ar">
<div class="place demo-output"></div>
<script src="assets/scripts/demo-ar.js" async></script>
</section>
<section class="slide black">
<h2>Augmented reality</h2>
<pre>
<code><script src=".../aframe.min.js"></script></code>
<code><script src=".../aframe-ar.js"></script></code>
</pre>
</section>
<section class="slide black">
<h2>Augmented reality</h2>
<pre>
<code><body style='margin : 0px; overflow: hidden;'></code>
<code><a-scene embedded artoolkit='sourceType: webcam;'></code>
<code> <a-box position='0 0 0.5' material='opacity: 0.7;'></a-box></code>
<code> <a-marker-camera preset='hiro'></a-marker-camera></code>
<code></a-scene></code>
<code></body></code>
</pre>
</section>
<section class="slide black">
<h2 class="shout shrink">What's next?</h2>
</section>
<section class="slide black">
<h2>You can do</h2>
<ol>
<li>Conference with WebRTC</li>
<li class="next">PWA like native photo app</li>
<li class="next">VR/AR</li>
</ol>
</section>
<section class="slide black" id="see-more">
<h2 class="shout">
<a href="https://github.com/Zmoki/awesome-media-streams/">See more on GitHub</a>
</h2>
<style>
#see-more h2 {
font-size:100px
}
</style>
</section>
<section class="slide black">
<h2>Thank you!</h2>
<div class="place">
<h2>
<a href="https://goo.gl/EmVRqo">https://goo.gl/EmVRqo</a>
</h2>
<br>
<h2>
<a href="https://twitter.com/Zmoki">@Zmoki</a>
</h2>
</div>
</section>
<footer class="badge">
<a href="https://github.com/Zmoki/talk-webcam-2017-shower">See me on GitHub</a>
</footer>
<div class="progress"></div>
<script src="node_modules/shower-core/shower.min.js"></script>
<!-- Copyright © 2017 Yours Truly, Famous Inc. -->
</body>
</html>