-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathmedia-capture.js
executable file
·41 lines (37 loc) · 1.23 KB
/
media-capture.js
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
// Set Fullscreen
monitor = document.getElementById('monitor');
keyBoard = document.getElementById('keyboard');
button = document.getElementById('fullscreen');
video = document.getElementById('video');
butterfly = document.getElementById('butterfly');
button.onclick = function toggleFullScreen() {
document.body.className = 'dark-background';
video.className = 'full-video';
info.className += ' hide';
monitor.className += ' hide';
keyBoard.className += ' hide';
}
var observer = new MutationObserver(function (event) {
if (document.body.className == "dark-background") {
document.addEventListener('keydown', function(event) {
if (event.keyCode = 27) {
document.body.className = 'light-background';
video.className = 'regular-video';
info.className -= ' hide';
monitor.className -= ' hide';
keyBoard.className -= ' hide';
butterfly.className -= ' hide';
}
})
}
})
observer.observe(video, {
attributes: true,
attributeFilter: ['class'],
childList: false,
characterData: false
})
// Capturing Media
const videoElement = document.querySelector('video');
const videoSelect = document.querySelector('videoSource');
const audioSelect = document.querySelector('audioSource');