Skip to content

Commit

Permalink
test(mediaAspect): log to debug on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
evandrododo committed Dec 10, 2023
1 parent 3f2e571 commit bc873c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/VideoPlane/VideoPlane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const VideoPlane = ({ userMedia }: { userMedia: MediaStream }) => {
const mediaWidth = userMedia.getVideoTracks()[0].getSettings().width || 1;
const mediaHeight = userMedia.getVideoTracks()[0].getSettings().height || 1;
const mediaAspect = mediaWidth / mediaHeight;
let size = useAspect(mediaAspect, 1, 0.1);
const size = useAspect(mediaAspect, 1, 0.1);

return (
<mesh scale={size} position={[0, 0, 0]}>
Expand Down
6 changes: 4 additions & 2 deletions src/components/WebCamVideoPlane/WebCamVideoPlane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ export const WebCamVideoPlane = () => {
// Gets user webcam
useEffect(() => {
const media = navigator.mediaDevices.getUserMedia({
video: true,
video: {
facingMode: "environment",
},
});

media.then((stream) => {
console.log("stream", stream.getVideoTracks()[0].getSettings());
console.log("stream", stream);
setUserMedia(stream);
});
}, []);
Expand Down

0 comments on commit bc873c1

Please sign in to comment.