Created
May 21, 2020 02:22
-
-
Save shoebappa/3ef4f0293fef97812ffd6b0074d21158 to your computer and use it in GitHub Desktop.
Bookmarklet of https://github.com/ahmed-musallam/cam1.app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function()%7Bvar%20el%3Ddocument.createElement(%22video%22)%3Bel.style.cssText%3D%22position%3A%20fixed%3Btop%3A%200%3Bleft%3A%200%3Bz-index%3A%20100000%3Bmin-width%3A%20100%25%3Bmin-height%3A%20100%25%3B%22%2Cel.autoplay%3D!0%2Cdocument.body.appendChild(el)%2Cnavigator.mediaDevices.getUserMedia(%7Bvideo%3A!0%7D).then(function(e)%7Bel.srcObject%3De%7D).catch(function(e)%7Bconsole.error(e)%2Calert(%22Enable%20your%20camera%22)%7D)%7D)() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var el = document.createElement('video'); | |
el.style.cssText = 'position: fixed;top: 0;left: 0;z-index: 100000;min-width: 100%;min-height: 100%;'; | |
el.autoplay = true; | |
document.body.appendChild(el); | |
navigator.mediaDevices.getUserMedia({ | |
video: true | |
}) | |
.then(function (s) { | |
el.srcObject = s; | |
}) | |
.catch(function(e) { | |
console.error(e); | |
alert("Enable your camera"); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add bookmarklet to bookmark bar and add your video to any webpage...