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: merge media controls. #805

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

csponge
Copy link
Contributor

@csponge csponge commented Feb 18, 2025

Initial commit to merge audio/video files. There are still a few bugs around widget sizing that need fixing.

Initial commit to merge audio/video files. There are
still a few bugs around widget sizing that need fixing.
@CyanVoxel CyanVoxel added Type: Enhancement New feature or request Type: Refactor Code that needs to be restructured or cleaned up Type: UI/UX User interface and/or user experience labels Feb 18, 2025
@CyanVoxel CyanVoxel linked an issue Feb 18, 2025 that may be closed by this pull request
3 tasks
Add widgets to a sublayout to allow for centering
in a QStackedLayout.

Remove references to the legacy video player in
the thumb preview.
@csponge
Copy link
Contributor Author

csponge commented Feb 23, 2025

Hi @CyanVoxel. I think I'm getting closer, but still running into an issue with correctly fitting the overlay with the thumbnail. Is there an easy way to get the size of the rendered thumbnail image?

Thanks!

@CyanVoxel
Copy link
Member

Thank you for your work on this so far! It should be fairly straightfoward to get the size of an image, but it differs a bit depending on what type of variable it is. PIL images have .width and .height properties while QPixmaps have .width() and .height() methods along with a .size() method which returns both as a QSize object. Depending on what you're doing it also may or may not be necessary to take into account the screen pixel ratio. Qt usually takes care of this for you, but images rendered from PIL do not.

As of your last commit I don't think I see the issue you're describing, but it might be part of the screenshot I've attached below. Since you're getting closer to finishing I also went ahead and jotted down some quick feedback based on the current state of the PR:

  • The volume and playback sliders can't be clicked anywhere along the bar to set their values and instead can only be changed by dragging the handle. If it was just the volume silder then maybe this could pass, but it makes playback seeking rather difficult. (Maybe this post could be of help?)
  • Given certain video sizes the volume slider covers the playback timers and potentially gets cut off of the screen image
  • The toggle mute setting is not respected
  • The autoplay setting is not respected
  • The right-click context menu is missing
  • Clicking on the preview outside of the controls opens the file - while this is the default behavior for other file types such as images, for media playback this is undesirable and the more intuitive behavior would be for the pause state to be toggled

@csponge
Copy link
Contributor Author

csponge commented Feb 25, 2025

Hi,

Thanks for the comment! I'll be sure to work on those features/fixes.

On my original issue, here is a screenshot of the issue I'm having:
overlay_oversized

In this case, the thumbnail image stops growing, while the rest of the media player widget keeps growing. This only happens when I make the preview panel very large.

Let me know if you have any questions.

@CyanVoxel
Copy link
Member

In this case, the thumbnail image stops growing, while the rest of the media player widget keeps growing. This only happens when I make the preview panel very large.

Ahh, I see! It looks like this is due to the max resolution used for the preview panel thumb which is 512x512 in most places. It's unfortunately a messy hardcoded limit sprinkled around the codebase. I won't stop you if you're interested in improving it, but I also wouldn't burden you with that for this feature.

Subclass QSlider to handle click events
and allow for easier seeking.

Implement context menu along with autoplay
setting for the media widget.

Pause video when media player is clicked
instead of opening file.
@csponge
Copy link
Contributor Author

csponge commented Feb 28, 2025

Hi,

I just pushed a fix that should fix the sliders, autoplay, context menu, and the behavior when clicking on the media widget. I am running into a mypy issue that I'm not sure how to resolve yet.

On the thumbnail sizing, I guess I could also lock it to 512x512 for now. I'll try to get that in the next commit.

I have some questions on the your other comments:

  • What should the behavior be when there is not enough space to display all the widgets? Do I need to resize them? Hide some of them?
  • How should toggle mute behave? I assume it would be similar to the autoplay setting. Start the media muted?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request Type: Refactor Code that needs to be restructured or cleaned up Type: UI/UX User interface and/or user experience
Projects
Status: 🚧 In progress
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Single Control Set for Audio/Video Files
2 participants