dkaoster / scrolly-video

Components for scroll-based (or other externally controlled) playback.
https://scrollyvideo.js.org/
MIT License
971 stars 39 forks source link

Fixed height is not working. #72

Closed anisulislampranto closed 10 months ago

anisulislampranto commented 12 months ago

I want to set a fixed height for the video and it's not working. and it is behaving wired.

Screenshot 2023-11-23 at 8 56 11 PM

Uploading Screen Recording 2023-11-23 at 8.59.49 PM.mp4…

dkaoster commented 11 months ago

Hi, are you able to provide more details such as a github repo where I can see the issue? This is a little bit difficult to know what the issue is.

anisulislampranto commented 11 months ago

Hi, are you able to provide more details such as a github repo where I can see the issue? This is a little bit difficult to know what the issue is.

https://github.com/anisulislampranto/onscroll-video-play this is a dummy repo i can't show you the real repo because it is private. but code is same. anyway. now from this code i want to give a fixed height. how can i do it ?

dkaoster commented 11 months ago

Hi @anisulislampranto,

For the dummy repo you sent me, I was able to set a fixed height by adding:

<style>
{`.mt-20 video {
height: 400px !important;
min-height: unset !important;
}`}
</style>

Yes, this is a little bit hacky and not the best way to do it, but for now there is no easy way to customize the style of the video beyond what is written in the documentation. I'll keep this in mind for future versions, and am also happy to review a PR if you'd like to build out this feature.

anisulislampranto commented 11 months ago

Hi @anisulislampranto,

For the dummy repo you sent me, I was able to set a fixed height by adding:

<style>
{`.mt-20 video {
height: 400px !important;
min-height: unset !important;
}`}
</style>

Yes, this is a little bit hacky and not the best way to do it, but for now there is no easy way to customize the style of the video beyond what is written in the documentation. I'll keep this in mind for future versions, and am also happy to review a PR if you'd like to build out this feature.

it is not working somehow. could you have a look at the code i've pushed.

dkaoster commented 11 months ago

Screenshot 2023-11-26 at 11 54 41 AM

works perfectly for me in both firefox and chrome, the height is now fixed to 400px as set in the css.