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> object-fit: cover in mux-player-react #380

Closed
luwes opened this issue Sep 12, 2022 · 7 comments
Closed

<video> object-fit: cover in mux-player-react #380

luwes opened this issue Sep 12, 2022 · 7 comments
Labels

Comments

@luwes
Copy link
Contributor

luwes commented Sep 12, 2022

Hello,
How i can setup object-fit: cover for the video element, in mux-player-react?
Thank you

Originally posted by @ProofWoW in #125 (comment)

@luwes luwes added the enhancement New feature or request label Sep 12, 2022
@gkatsev
Copy link
Contributor

gkatsev commented Sep 12, 2022

Looks like there isn't a good way to do this from mux-player. We do export <video> as a ::part from mux-video. We could re-export it on mux-player, which I think would be better than exposing an option or a CSS variable specifically for object-fit.
Though, @cjpillsbury does have some concerns about exposing this, since internal styles or new defaults might interfere with CSS that folks might add to the ::part

@wiesson
Copy link

wiesson commented Sep 13, 2022

How do I use it?
I also was looking for this! I tried sth like this, but no result (no experience with web components so far)

mux-video::part(video) {
  object-fit: cover;
}

@luwes
Copy link
Contributor Author

luwes commented Sep 13, 2022

@ProofWoW @mikker we are on the fence of adding this to the Mux player because it could potentially result in breaks if we decide to change any styles on the internal video element in the future. What exactly is the use-case?

Is it to fix letterboxing or hairline black edges around the video content?

Would a custom CSS var be able to cover the use-case?
Is it only for adding object-fit: cover?


Thanks for the feedback @wiesson !

What's the high level reasoning for adding object-fit: cover; to the video element in your use-case?

Thank you!

@wiesson
Copy link

wiesson commented Sep 13, 2022

I'm experimenting to add the mux-player here on this page -> https://www.douglas.de/de/cp/videos/video-overview (instead of an overlay, it could start inline) but the tiles have different sizes across multiple platforms. They also should align with the other product tiles.

Is there anything I can do to style the shadow dom element from outside?

@luwes
Copy link
Contributor Author

luwes commented Sep 13, 2022

@wiesson at the moment there is no way to do this. we'll try to add this soon as it seems highly requested.

@mikker
Copy link
Contributor

mikker commented Sep 14, 2022

My use case is that I want the player to have the full height of the window. So,

mux-player::part(video) {
  height: 100vh;
}

This works great when I add the exportparts="video: video" attribute to <mux-video> inside <mux-player>.

I see your point about being hesitant to let users style too much so you don't break it with updates. I think though that the vast majority of folks customizing in this way would be aware that there's a risk the styles might change. That in mind + sticking somewhat to semantic versioning with the player, I don't see any problems with adding a direct way to style individual parts.

@luwes
Copy link
Contributor Author

luwes commented Sep 17, 2022

Thanks all! This feature is added and released https://github.com/muxinc/elements/releases/tag/%40mux%2Fmux-player%401.0.0-beta.0

@luwes luwes closed this as completed Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants