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

feat: make volume slider responsive according to player size #1356

Merged

Conversation

Pompette
Copy link
Contributor

@Pompette Pompette commented Oct 1, 2022

#1352

As mention in the bug report, the volume is not responsive if the player has a small width.

Integration

volumeSliderVertical

Under 480px, I considerer that the width is small (we can change this value by changing the MAX_MOBILE_WIDTH value)

According to the case, there was two possible width :

  • Width configured on the player
  • window.innerWidth

If the fullScreen is enabled, then I check the innerWidth, otherwise I rely on the width that was configure on the player.

If the player is small, then I delete the injectedCSS for the horizontal display and inject the one for the vertical.


IssueHunt Summary

Referenced issues

This pull request has been submitted to:


@vercel
Copy link

vercel bot commented Oct 1, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
remotion ✅ Ready (Inspect) Visit Preview Oct 4, 2022 at 0:00AM (UTC)

@JonnyBurger
Copy link
Member

Thanks a lot for the PR! It is also eligible for a $150 bounty during Hacktoberfest if acceptance criteria is fulfilled.
I have not yet defined those and also not yet reviewed your PR, but will do that tomorrow. I think it's already very close :)

@Pompette
Copy link
Contributor Author

Pompette commented Oct 3, 2022

You're welcome, it was a pleasure to work on it 🙂 !

That's so cool for the bounty, I'm indeed participating to the Hacktoberfest event, I registered to IssueHunt and submitted the PR, thanks for that it's awesome !

I'll check if it's filling acceptance criteria's you specified, and come back to you if I have any question about it.

Time label now cannot overflow to other component, if it goes above the space available overflow is show as ellipsis.
Creation of custom hook that handle the resize of component.
@Pompette
Copy link
Contributor Author

Pompette commented Oct 3, 2022

Enregistrement.de.l.ecran.2022-10-04.a.00.12.20.mov

Hey again 👋 ,

To fulfill the Acceptance criteria "Make slider go upwards if space is not sufficient" I've made some improvement to what I've done before, let me know if this way is fine for you.

Thing to keep in mind is that I consider the width not enough if Time label width with slider open is not more than the slider width itself.

@JonnyBurger
Copy link
Member

Works great! Thanks a lot!

The only thing I changed besides some refactors is that instead of the composition width, I took the real player width how it is rendered as the factor deciding whether to show the slider vertically or horizontally.

The bounty is paid out, out of curiosity and for statistics, how long did it take you approximately to work on this issue?

@JonnyBurger JonnyBurger merged commit cbc5186 into remotion-dev:main Oct 4, 2022
@JonnyBurger JonnyBurger linked an issue Oct 4, 2022 that may be closed by this pull request
@Pompette
Copy link
Contributor Author

Pompette commented Oct 6, 2022

It's fine, thanks to you @JonnyBurger :) !

Yes I saw, great refacto, I was not a big fan of how the CSS was injected either ! Out of curiosity, did you plan to change inline styling in the futur ?

Nice see for the playerWidth, didn't notice we could retrieve it that way !

Mmh, I think something between 3 to 4 hours.

Dig into the project, find right files, run local example : 30min / 50min
First draft : 1h
Second draft : 2h (computing the resize was the longest part, it lead to manage timeLabel size and overflow behavior etc..)

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.

volume component of Player is not responsively designed
2 participants