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

Fixed Plyr container not resizing responsively #1651

Merged
merged 1 commit into from
Jan 21, 2020
Merged

Fixed Plyr container not resizing responsively #1651

merged 1 commit into from
Jan 21, 2020

Conversation

shravan2x
Copy link
Contributor

@shravan2x shravan2x commented Jan 19, 2020

Link to related issue (if applicable): #1634

Summary of proposed changes

The main change was adding height: 100%s in a few places. I also had to update preview-thumbnails.js to support the new changes.

Checklist

  • Use develop as the base branch
  • Exclude the gulp build (/dist changes) from the PR
  • Test on supported browsers

I use these fixes in a private app and they work fine. However, I had to change them a little when I copied them over. So this PR needs to be tested to verify that

  • it fixes the problem and
  • it doesn't inadvertently break something else.

I'd appreciate help testing it since I'm not able to do it myself at the moment.

@ghost
Copy link

ghost commented Jan 19, 2020

just tested it and it works

@sampotts
Copy link
Owner

sampotts commented Jan 21, 2020

Thanks for looking into this and creating a decent PR! 👍

The only styling I'm concerned about is the height: 100% on the parent container. Is that needed?

Edit: Also, setting height on the video wrapper may break the ratio functionality. I'll do some testing though.

@sampotts sampotts merged commit b6d94e0 into sampotts:develop Jan 21, 2020
@shravan2x
Copy link
Contributor Author

shravan2x commented Jan 22, 2020

@sampotts Thanks for the quick response!

The height: 100% on both the parent and the wrapper seemed to be needed in my testing. Did you find otherwise?

I think it may also matter in which context users currently use Plyr. If they use it somewhere like a blog, the width: 100%; height: auto; might be a better choice (since blogs usually are vertically stacked). But for a full responsive experience, the height: 100% would work better IMO. If users want to constrain it to a specific size, they could just put the Plyr instance inside a container <div> of any size they want. We could retain backward compatibility by adding a responsive: boolean option in config, but I think most people would accept the new behavior as reasonable.

@ghost
Copy link

ghost commented Jan 24, 2020

this is my testing. i use fancybox 3 with plyr in some of my pages and this is the results i get
before
DeepinScreenshot_select-area_20200124092804
after
DeepinScreenshot_select-area_20200124092951

@kgnfth
Copy link

kgnfth commented Nov 17, 2020

@sampotts Why is height: 100%; removed from https://github.com/sampotts/plyr/blob/master/src/sass/base.scss

@sampotts
Copy link
Owner

It was this pull request:
#1997

I'm guessing it needs reverting then?

@kgnfth
Copy link

kgnfth commented Nov 17, 2020

@sampotts im not the expert but after they removed it, its is back to this issues

image

@shravan2x
Copy link
Contributor Author

shravan2x commented Nov 17, 2020

When I initially made this PR, the height: 100% was definitely required. From #1997 it sounds to me like a Bootstrap issue or some missing code on their end.

@sampotts
Copy link
Owner

Could you try max-height: 100% on the .plyr element? Perhaps that's a happy medium.

@kgnfth
Copy link

kgnfth commented Nov 17, 2020

@sampotts

image

but for vertical vids this happens

without max-height: 100%

image

with max-height: 100%

image

@kgnfth
Copy link

kgnfth commented Nov 17, 2020

@sampotts it should be like this #1651 (comment)

@shravan2x
Copy link
Contributor Author

@kgnfth Could you try adding max-height: 100% on both .plyr and .plyr-video-wrapper? You could also try adding an object-fit: contain on the latter.

@kgnfth
Copy link

kgnfth commented Nov 17, 2020

@shravan2x same as above

you can try here https://tumbly.gocloud.fun/test/lolvideoslol

@shravan2x
Copy link
Contributor Author

shravan2x commented Nov 17, 2020

I think I have a solution that should fix both this issue and the other one. Working on another PR now.

@shravan2x
Copy link
Contributor Author

shravan2x commented Nov 17, 2020

@kgnfth Could you try shravan2x@c6376b6 #2022? If you aren't able to build Plyr entirely you could try making those changes in devtools directly. It's only a few fixes.

@sampotts
Copy link
Owner

Thanks for working this out and sorry for the hassle 👍

@shravan2x
Copy link
Contributor Author

@sampotts Least I could do after all the work you've put into this amazing MIT licensed repository 🙂

If that fix works, the PR is #2022

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

Successfully merging this pull request may close these issues.

3 participants