You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, how about using navigator.mediaDevices, a front-end API, this works on the Wails app.
A simple exmple like:
functionhandleMediaStream(MediaStream){console.log('MediaStream Object:',MediaStream)constvideo=document.createElement('video');video.controls=true;video.srcObject=MediaStream;video.onloadedmetadata=function(){video.play();};varcontainer=document.getElementById('videoContainer');container.appendChild(video);};functiongetUserMedia(){try{constoptions={audio: true,video: true,}if(navigator.mediaDevices.getUserMedia){navigator.mediaDevices.getUserMedia(options).then(function(MediaStream){handleMediaStream(MediaStream)}).catch(function(err){console.error(err);})}elseif(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia){try{navigator.getUserMedia(options,function(MediaStream){handleMediaStream(MediaStream)},function(err){console.error(err);})}catch(error){console.error(err);}}else{console.error("Your browser does not support getUserMedia API");}}catch(error){console.error(error);}};getUserMedia();
Have you read the Documentation Contribution Guidelines?
Description
Only barely mentioned here:
How to use the webcam/camera feed in a Wails app?
Self-service
The text was updated successfully, but these errors were encountered: