UNDERCODE SECURITY
225 subscribers
295 photos
1.03K files
1.73K links
🦑WELCOME IN UNDERCODE TESTING FOR LEARN HACKING | PROGRAMMING | SECURITY & more..

THIS CHANNEL BY :

@UndercodeTesting
UndercodeTesting.com (official)

@iUndercode
iUndercode.com (iOs)

@Dailycve
DailyCve.com


@UndercodeNews
UndercodeNews.com
Download Telegram
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁

🦑CODE ACCESS WEBCAM VIA HTML by undercde :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="Display Webcam Stream" name="title">
<title>Display Webcam Stream</title>
<style>
body {
margin: 30px;
}

h1 {
font-family: sans-serif;
color: #666;
}

#container {
width: 500px;
height: 375px;
border: 10px #333 solid;
}

#videoElement {
width: 500px;
height: 375px;
background-color: #666;
}

button {
margin-top: 20px;
font-size: 12px;
font-weight: bold;
padding: 5px;
background-color: white;
border: 5px solid black;
}

button:hover {
background-color: yellow;
}

button:active {
background-color: yellowgreen;
}
</style>
</head>
<body>
<h1>Проверка веб камеры онлайн</h1>
<div id="container">
<video autoplay id="videoElement">
</video>
</div>
                              <button id="stop">Stop Video</button>               
<button id="start">Start Video</button>
<script>

var video = document.querySelector("#videoElement");
var stopVideo = document.querySelector("#stop");
var startVideo = document.querySelector("#start");


stopVideo.addEventListener("click", stop, false);
startVideo.addEventListener("click", startWebCam, false);


function startWebCam() {
if (navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({video: true})
.then(function (stream) {
video.srcObject = stream;
})
.catch(function (err0r) {
console.log("Something went wrong!");
});
}
}

function stop(e) {
var stream = video.srcObject;
var tracks = stream.getTracks();

for (var i = 0; i < tracks.length; i++) {
var track = tracks[i];
track.stop();
}

video.srcObject = null;
}
</script>
</body>
</html>

by undercode
▁ ▂ ▄ U𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁