Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

video is not full screen #19

Open
kordou opened this issue Jul 17, 2023 · 3 comments
Open

video is not full screen #19

kordou opened this issue Jul 17, 2023 · 3 comments

Comments

@kordou
Copy link

kordou commented Jul 17, 2023

hi all
i am trying to make the video from example of image tracking into full screen.
i tried to change the video element in css to width:100vw and hight:100vh but still nothing

can somene help me on that ?

thank you

@kordou
Copy link
Author

kordou commented Jul 28, 2023

anyone here for answer

@r3s
Copy link

r3s commented Aug 3, 2023

Instead of using CSS, did you try with JS? Once the video element loads, changing the width and height to match the window width and height. Not sure if that'd work because I have not tested it. But worth a try I guess. Do you have a sandbox link or something else to test?

@amcc
Copy link

amcc commented Mar 18, 2024

This css will do it. I have given the ARView the class "ar-view" and then set the CSS as so:

.ar-view video {
  object-fit: cover;
  width: 100% !important;
  margin-left: unset !important;
}

The issue here is that the css is added to the video as an inline class, perhaps this can be altered as it makes it very hard to modify this stuff without the slightly alarming !important css addition above. Perhaps this stuff can be added as a class that can be overridden instead.

The code setting the styles that prevent the video being full screen is on line 196 here:
https://github.com/tommasoturchi/react-three-mind/blob/main/src/AR.js

However an issue here is that object-fit: cover enlarges the video to be full-screen using CSS, but this makes the AR not fit the video. So this needs to be done programatically if you want the AR to say exactly cover a picture. Very happy for someone else to jump in here and suggest a good way of doing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants