Diferenças
Aqui você vê as diferenças entre duas revisões dessa página.
Ambos lados da revisão anteriorRevisão anteriorPróxima revisão | Revisão anterior | ||
camdesktop [28/04/2025 - 14:12:10] Thalles Lázaro | camdesktop [02/05/2025 - 15:17:16] (atual) Thalles Lázaro | ||
---|---|---|---|
Linha 1: | Linha 1: | ||
+ | ====== CamDesktop WebCam Flutuante Online ====== | ||
+ | |||
< | < | ||
- | |||
- | < | ||
- | |||
- | document.addEventListener(' | ||
- | if(!/ | ||
- | if (/ | ||
- | fetch(" | ||
- | .then(() => { | ||
- | }) | ||
- | .catch(() => { | ||
- | document.getElementById(" | ||
- | }); | ||
- | } | ||
- | } | ||
- | }); | ||
- | |||
- | </ | ||
- | |||
- | <div class=" | ||
- | |||
- | |||
- | <a href=" | ||
- | <div id=" | ||
- | Clique aqui e instale nossa extensão CamDesktop para Chrome ou Edge agora mesmo! | ||
- | </ | ||
- | </a> | ||
- | |||
- | |||
- | <div class=" | ||
- | <div class=" | ||
- | <div id=" | ||
- | <video id=" | ||
- | <div class=" | ||
- | <div> | ||
- | <div class=" | ||
- | <p> [Enter] para Abrir WebCam Flutuante <br> [Espaço] para Foto Instantânea <br> [Tab] para Abrir e Fechar esse Texto <br> [F11] para Tela Cheia </p> | ||
- | </ | ||
- | </ | ||
- | </ | ||
- | <div class=" | ||
- | <select id=" | ||
- | <select id=" | ||
- | <option value=" | ||
- | <option value=" | ||
- | <option value=" | ||
- | <option value=" | ||
- | <option value=" | ||
- | <option value=" | ||
- | <option value=" | ||
- | <option value=" | ||
- | </ | ||
- | <a id=" | ||
- | </ | ||
- | <canvas class=" | ||
- | <img class=" | ||
- | </ | ||
- | </ | ||
- | <div class=" | ||
- | <div id=" | ||
- | < | ||
- | < | ||
- | </ | ||
- | <p class=" | ||
- | <p class=" | ||
- | </ | ||
- | </ | ||
- | |||
- | |||
- | </ | ||
- | |||
- | |||
< | < | ||
- | #webcam{ | + | h1{display:none!important;} |
- | -webkit-user-select: | + | </ |
- | -ms-user-select: none; | + | |
- | user-select: | + | |
- | } | + | |
- | #webcam .view, .tips > div { | + | <iframe allowtransparency="true" |
- | width: 100%; | + | |
- | height: 100%; | + | |
- | } | + | |
- | + | ||
- | #webcam .view[data-active="false"] > video, | + | |
- | #webcam .view[data-active=" | + | |
- | .hide2{ | + | |
- | display: none; | + | |
- | } | + | |
- | + | ||
- | .hide { | + | |
- | display: none!important; | + | |
- | } | + | |
- | + | ||
- | #webcam{ | + | |
- | position: relative; | + | |
- | } | + | |
- | + | ||
- | #webcam video { | + | |
- | display: block; | + | |
- | width: 100%; | + | |
- | height: auto; | + | |
- | background: #000; | + | |
- | -webkit-app-region: | + | |
- | aspect-ratio: | + | |
- | } | + | |
- | + | ||
- | # | + | |
- | display: table; | + | |
- | position: absolute; | + | |
- | top: 0; | + | |
- | left: 0; | + | |
- | background: #000; | + | |
- | background: rgba(0, 0, 0, 0.5); | + | |
- | color: #fff; | + | |
- | text-align: center; | + | |
- | overflow: hidden; | + | |
- | font-size: 16px; | + | |
- | } | + | |
- | + | ||
- | #webcam .tips > div a { | + | |
- | color: #fff; | + | |
- | font-size: 3em; | + | |
- | } | + | |
- | + | ||
- | #webcam .tips .tipsText { | + | |
- | color: #fff; | + | |
- | display: table-cell; | + | |
- | vertical-align: | + | |
- | z-index: 1; | + | |
- | text-shadow: | + | |
- | } | + | |
- | + | ||
- | #webcam .select { | + | |
- | position: absolute; | + | |
- | top: 0; | + | |
- | left: 0; | + | |
- | right: 0; | + | |
- | } | + | |
- | + | ||
- | #webcam .select, .select option { | + | |
- | -webkit-app-region: | + | |
- | } | + | |
- | + | ||
- | #webcam .centa { | + | |
- | text-align: center; | + | |
- | } | + | |
- | + | ||
- | #webcam # | + | |
- | width: 48%; | + | |
- | border: 0; | + | |
- | border-radius: | + | |
- | padding: 5px; | + | |
- | text-align: center; | + | |
- | margin: 5px 0; | + | |
- | display: inline-block; | + | |
- | } | + | |
- | + | ||
- | @media (hover: none) and (pointer: coarse) and (orientation: | + | |
- | #webcam .tips{display: | + | |
- | } | + | |
- | + | ||
- | </style> | + | |
+ | <video id=" | ||
< | < | ||
- | + | iframe = document.getElementById(" | |
- | function setCookie(cname, cvalue, exdays) { | + | iframe.onload |
- | var d = new Date(); | + | iframe.contentWindow.document.body.style.background = window.getComputedStyle(document.body, null).getPropertyValue(' |
- | d.setTime(d.getTime() + 10000 + (exdays * 24 * 60 * 60 * 1000)); | + | |
- | var expires = " | + | |
- | document.cookie = cname + " | + | |
} | } | ||
- | + | window.onresize = function(){ | |
- | function | + | iframe.style.height |
- | var name = cname + " | + | |
- | var decodedCookie = decodeURIComponent(document.cookie); | + | |
- | var ca = decodedCookie.split(';' | + | |
- | for (var i = 0; i < ca.length; i++) { | + | |
- | var c = ca[i]; | + | |
- | while (c.charAt(0) === ' ') { | + | |
- | c = c.substring(1); | + | |
- | } | + | |
- | if (c.indexOf(name) === 0) { | + | |
- | return c.substring(name.length, | + | |
- | } | + | |
- | } | + | |
- | return "" | + | |
} | } | ||
+ | setInterval(function(){ | ||
+ | iframe.style.height = iframe.contentWindow.document.body.scrollHeight + ' | ||
+ | }, 500); | ||
+ | </ | ||
+ | </ | ||
- | var videoElement | + | ===== Entenda um pouco sobre o CamDesktop ===== |
- | videoSelect | + | O CamDeskop é uma ferramenta útil para várias ocasiões. Sua função se resume a mostrar sua própria webcam na sua tela de um modo que possa ficar flutuante acima de outras janelas e programas no seu computador, sem qualquer opção de gravação, edição ou efeitos especiais. Ou seja: ele apenas abre uma janela flutuante na sua tela mostrando sua webcam como se fosse um espelho. |
- | videoSize | + | |
- | canvas | + | |
- | ctx = canvas.getContext(" | + | |
- | snapshot = document.getElementById(" | + | |
- | selectors = [videoSelect]; | + | |
+ | Suas melhores características, | ||
- | videoElement.addEventListener(' | + | A opção "Tela Cheia com F11" é bem útil, pois caso você queira deixar a sua webcam espelhada na tela toda você pode. |
- | document.querySelector("# | + | O CamDesktop tem função que parece boba, mais em muitos caso é bem útil. Imagine poder gravar a tela do seu computador mostrando sua webcam de um modo que você pode move-la para onde quiser, a melhor vantagem de todas é que você não precisa instalar nenhum outro software de webcam, é só acessar o site, dar a permissão para o navegador acessar sua webcam, apertar Enter e pronto, lá está sua webcam em janela flutuante. |
- | document.querySelector(' | + | {{ :inicio: |
- | behavior: ' | + | |
- | }); | + | |
- | }); | + | ===== O que eu posso fazer com o CamDesktop? ===== |
+ | Você pode manter sua webcam em filmagem constante e sobre todos os outros programas, de forma que você consiga assistir o tempo todo ao que está sendo capturado na câmera. | ||
- | videoElement.addEventListener(' | + | ===== O CamDesktop está disponível para quais plataformas? |
+ | CamDesktop está disponível para Windows, Linux, MacOS, ChromeOS, Android e iOS. Você não precisa instalar nada, basta acessar o site CamDesktop e usar a ferramenta direto do site. | ||
- | document.querySelector("# | + | ===== Como o CamDesktop funciona? ===== |
- | + | O CamDesktop | |
- | document.querySelector(' | + | |
- | behavior: ' | + | |
- | }); | + | |
- | + | ||
- | }); | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | navigator.getUserMedia | + | |
- | navigator.webkitGetUserMedia || navigator.mozGetUserMedia; | + | |
- | + | ||
- | window.URL | + | |
- | + | ||
- | function gotSources(deviceInfos) { | + | |
- | // Handles being called several times to update labels. Preserve values. | + | |
- | var values | + | |
- | return select.value; | + | |
- | }); | + | |
- | selectors.forEach(function(select) { | + | |
- | while (select.firstChild) { | + | |
- | select.removeChild(select.firstChild); | + | |
- | } | + | |
- | }); | + | |
- | + | ||
- | + | ||
- | for (var i = 0; i !== deviceInfos.length; | + | |
- | var deviceInfo = deviceInfos[i]; | + | |
- | var option = document.createElement(' | + | |
- | option.value = deviceInfo.deviceId; | + | |
- | if (deviceInfo.kind === ' | + | |
- | option.text = deviceInfo.label || ' | + | |
- | videoSelect.appendChild(option); | + | |
- | } else { | + | |
- | // | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | selectors.forEach(function(select, | + | |
- | if (Array.prototype.slice.call(select.childNodes).some(function(n) { | + | |
- | return n.value === values[selectorIndex]; | + | |
- | })) { | + | |
- | select.value = values[selectorIndex]; | + | |
- | } | + | |
- | }); | + | |
- | } | + | |
- | + | ||
- | navigator.mediaDevices.enumerateDevices().then(gotSources).catch(handleError); | + | |
- | + | ||
- | if (typeof MediaStreamTrack === " | + | |
- | typeof MediaStreamTrack.getSources === " | + | |
- | // alert(" | + | |
- | } else { | + | |
- | MediaStreamTrack.getSources(gotSources); | + | |
- | } | + | |
- | + | ||
- | function successCallback(stream) { | + | |
- | window.stream = stream; // make stream available to console | + | |
- | videoElement.src = window.URL.createObjectURL(stream); | + | |
- | videoElement.play(); | + | |
- | } | + | |
- | + | ||
- | function errorCallback(error) { | + | |
- | console.log(" | + | |
- | } | + | |
- | + | ||
- | function gotStream(stream) { | + | |
- | window.stream = stream; // make stream available to console | + | |
- | videoElement.srcObject = stream; | + | |
- | // Refresh button list in case labels have become available | + | |
- | return navigator.mediaDevices.enumerateDevices(); | + | |
- | } | + | |
- | + | ||
- | function start() { | + | |
- | + | ||
- | document.querySelector("# | + | |
- | + | ||
- | if (window.stream) { | + | |
- | window.stream.getTracks().forEach(function(track) { | + | |
- | track.stop(); | + | |
- | }); | + | |
- | } | + | |
- | + | ||
- | videoSizeAspectRatio = null; | + | |
- | if(videoSize.value == ' | + | |
- | videoSizeAspectRatio = 1/1; | + | |
- | } else if(videoSize.value == ' | + | |
- | videoSizeAspectRatio = 1/2; | + | |
- | } else if(videoSize.value == ' | + | |
- | videoSizeAspectRatio = 2/1; | + | |
- | } else if(videoSize.value == ' | + | |
- | videoSizeAspectRatio = 4/3; | + | |
- | } else if(videoSize.value == ' | + | |
- | videoSizeAspectRatio = 9/16; | + | |
- | } else if(videoSize.value == ' | + | |
- | videoSizeAspectRatio = 16/9; | + | |
- | } else if(videoSize.value == ' | + | |
- | videoSizeAspectRatio = 21/9; | + | |
- | } | + | |
- | + | ||
- | var videoSource = videoSelect.value; | + | |
- | var constraints = { | + | |
- | video: { | + | |
- | deviceId: videoSource | + | |
- | aspectRatio: | + | |
- | } | + | |
- | }; | + | |
- | navigator.mediaDevices.getUserMedia(constraints). | + | |
- | then(gotStream).then(gotSources).catch(handleError); | + | |
- | } | + | |
- | function handleError(error) { | + | |
- | console.log(' | + | |
- | } | + | |
- | + | ||
- | videoSelect.onchange | + | |
- | videoSize.onchange | + | |
- | + | ||
- | document.addEventListener(' | + | |
- | if(document.body.contains(videoElement) | + | |
- | console.log(" | + | |
- | document.onkeydown = function(e) { | + | |
- | // | + | |
- | if (e.which == 9) { | + | |
- | document.querySelector(" | + | |
- | e.preventDefault(); | + | |
- | } else if ( e.which == 32) { | + | |
- | document.querySelector("# | + | |
- | e.preventDefault(); | + | |
- | } else if (e.which == 13) { | + | |
- | document.querySelector("# | + | |
- | e.preventDefault(); | + | |
- | } else if (e.which == 122) { | + | |
- | if (videoElement.requestFullscreen) { | + | |
- | videoElement.requestFullscreen(); | + | |
- | } else if (videoElement.webkitRequestFullscreen) { /* Safari */ | + | |
- | videoElement.webkitRequestFullscreen(); | + | |
- | } else if (videoElement.msRequestFullscreen) { /* IE11 */ | + | |
- | videoElement.msRequestFullscreen(); | + | |
- | } | + | |
- | e.preventDefault(); | + | |
- | } | + | |
- | } | + | |
- | } | + | |
- | }); | + | |
- | + | ||
- | + | ||
- | + | ||
- | function detectBrowser(){ | + | |
- | var userAgent = navigator.userAgent; | + | |
- | var browserName = ""; | + | |
- | if(userAgent.match(/ | + | |
- | browserName = " | + | |
- | } else if(userAgent.match(/ | + | |
- | browserName = " | + | |
- | } else if(userAgent.match(/ | + | |
- | browserName = " | + | |
- | } else if(userAgent.match(/ | + | |
- | browserName = " | + | |
- | } else if(userAgent.match(/ | + | |
- | browserName = " | + | |
- | } | + | |
- | return browserName; | + | |
- | } | + | |
- | + | ||
- | + | ||
- | function mobileCheck(){ | + | |
- | var check = ""; | + | |
- | (function(a){if(/ | + | |
- | return check; | + | |
- | } | + | |
- | + | ||
- | + | ||
- | + | ||
- | document.querySelector(" | + | |
- | document.querySelector(" | + | |
- | } | + | |
- | + | ||
- | + | ||
- | // Take and Save Snapshot | + | |
- | document.querySelector("# | + | |
- | canvas.width = document.querySelector(" | + | |
- | canvas.height = document.querySelector(" | + | |
- | ctx.drawImage(videoElement, | + | |
- | snapshot.src = canvas.toDataURL(" | + | |
- | var iframe = Object.assign(document.createElement(' | + | |
- | onload() { | + | |
- | var doc = this.contentDocument; | + | |
- | var a = Object.assign(doc.createElement(' | + | |
- | href: canvas.toDataURL(" | + | |
- | download: ' | + | |
- | }); | + | |
- | doc.body.appendChild(a); | + | |
- | a.dispatchEvent(new MouseEvent(' | + | |
- | setTimeout(() => this.remove()); | + | |
- | }, | + | |
- | style: ' | + | |
- | }); | + | |
- | document.body.appendChild(iframe); | + | |
- | }; | + | |
- | + | ||
- | // Detect what operating system the user is using. | + | |
- | if ( navigator.platform.toLowerCase() === " | + | |
- | window.onkeydown = function(e) { | + | |
- | if ( e.metaKey && e.which == 82 ) { | + | |
- | location.reload(true); | + | |
- | } | + | |
- | }; | + | |
- | } else { | + | |
- | location.reload(true); | + | |
- | } | + | |
- | + | ||
- | + | ||
- | pip.addEventListener(' | + | |
- | + | ||
- | var permission_camera = ""; | + | |
- | + | ||
- | if(detectBrowser() != " | + | |
- | navigator.permissions.query({ name: " | + | |
- | permission_camera = res.state; | + | |
- | }); | + | |
- | } | + | |
- | + | ||
- | + | ||
- | if(permission_camera == " | + | |
- | alert(" | + | |
- | } | + | |
- | + | ||
- | if (document.pictureInPictureEnabled) { | + | |
- | if (document.pictureInPictureElement) { | + | |
- | document.exitPictureInPicture(); | + | |
- | } else { | + | |
- | if (document.pictureInPictureEnabled) { | + | |
- | videoElement.requestPictureInPicture(); | + | |
- | } | + | |
- | } | + | |
- | } else { | + | |
- | alert(" | + | |
- | } | + | |
- | + | ||
- | + | ||
- | }); | + | |
- | + | ||
- | + | ||
- | + | ||
- | document.addEventListener(' | + | |
- | if (!getCookie(" | + | |
- | + | ||
- | document.querySelector("# | + | |
- | + | ||
- | document.querySelector("# | + | |
- | setCookie(" | + | |
- | }; | + | |
- | + | ||
- | } else { | + | |
- | + | ||
- | urlTutorialDarPermissoes = "/ | + | |
- | + | ||
- | if(mobileCheck()){ | + | |
- | urlTutorialDarPermissoes = "/ | + | |
- | } | + | |
- | + | ||
- | if(detectBrowser() != " | + | |
- | navigator.permissions.query({ name: " | + | |
- | if(res.state == " | + | |
- | document.querySelector("# | + | |
- | } else { | + | |
- | document.querySelector("# | + | |
- | } | + | |
- | }); | + | |
- | } else { | + | |
- | document.querySelector("# | + | |
- | } | + | |
- | + | ||
- | start(); | + | |
- | + | ||
- | + | ||
- | } | + | |
- | }); | + | |
- | + | ||
- | document.querySelector("# | + | |
- | setCookie(" | + | |
- | location.href = location.href.split("#" | + | |
- | }; | + | |
- | + | ||
- | + | ||
- | </ | + | |
+ | ===== O CamDesktop armazena alguma gravação da WebCam? ===== | ||
+ | NÃO! O CamDesktop apenas reproduz para você mesmo sua WebCam, é como se fosse um espelho, nunca iremos armazenar nenhuma gravação sua, NUNCA! | ||
+ | ==== Deixe um Comentário ==== | ||
+ | < | ||
+ | <div class=" | ||
</ | </ |