Spaces:
Runtime error
Runtime error
HuggingFace-SK commited on
Commit ·
33d277b
1
Parent(s): 17c3f55
style flip camera btn
Browse files26 unmodified lines2728293031323334353637383912 unmodified lines5253545051525556575893 unmodified lines15215315415215315415515615715815915716016115916216316416516316616716816914 unmodified lines1841851861841871881891909 unmodified lines20020120220020320420520626 unmodified lines
<div class="container">
<video id="webcam" style="display:none" autoplay="" playsinline=""></video> <div class="canvas_wrapper" id="canvas_wrapper"> <button id="switch-camera" style="position: absolute; top:10px; left:10px; padding:5px; height:40px; width:40px; text-align: center; border-radius: 12.25px; font-size: 20px; font-weight: 900; border:none; background-color: #f2f2f2; box-shadow: 0px 4px 20px 4px rgba(0, 0, 0, 0.38); z-index:100"> <span>⟳</span> </button> <canvas class="output_canvas" id="output_canvas" width="100%" height="300%"></canvas> <center> <button id="webcamButton">12 unmodified lines <button id="text-to-speech" onclick="speak(document.getElementById('text').value)"> <span>Listen to the text 🔊</span> </button> <button id="switch-camera"> <span>Switch CM</span> </button>
</div> <center> <script>93 unmodified lines else { console.warn("getUserMedia() is not supported by your browser"); } async function switch_camera(){ if (video_facing_mode=='user'){ webcamRunning= false async function switch_camera() { if (video_facing_mode == 'user') { webcamRunning = false video_facing_mode = 'environment' await load_camera() webcamRunning= true webcamRunning = true } else{ else { webcamRunning = false video_facing_mode = 'user' await load_camera() webcamRunning= true webcamRunning = true } } // Enable the live webcam view and start detection.14 unmodified lines // getUsermedia parameters. load_camera() } function load_camera(){ function load_camera() { const constraints = { video: { facingMode: video_facing_mode9 unmodified lines let results = undefined; console.log(video); async function predictWebcam() { if (video.videoHeight == 0){ if (video.videoHeight == 0) { return } canvasElement.width = window.innerWidth;templates/browser-detect.html+14-11