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

Add a compact mode to the OSC #208

Closed
houssemko opened this issue Nov 13, 2024 · 58 comments · Fixed by #271
Closed

Add a compact mode to the OSC #208

houssemko opened this issue Nov 13, 2024 · 58 comments · Fixed by #271
Labels
feature request New feature or request planned Implementation of this behavior will be added in the future

Comments

@houssemko
Copy link

Expected behavior of the wanted feature

By moving the remaining time and total time in front and in the end of the progress bar , the OSC can be more compact

@houssemko houssemko added the feature request New feature or request label Nov 13, 2024
@Samillion

This comment was marked as resolved.

@houssemko

This comment was marked as resolved.

@Samillion

This comment was marked as resolved.

@Samillion Samillion reopened this Nov 14, 2024
@Samillion Samillion added the planned Implementation of this behavior will be added in the future label Nov 14, 2024
@houssemko

This comment was marked as resolved.

@xiaoleichen

This comment was marked as resolved.

@Samillion
Copy link
Owner

Samillion commented Dec 26, 2024

What do you guys think about this layout?

Also solves #264

Changes:

  • Reduce OSC footprint by re-organizing elements
  • Move chapter_title below title
  • Move time_stamp and cache_info

Untitled

@houssemko

This comment was marked as resolved.

@Samillion

This comment was marked as resolved.

@houssemko

This comment was marked as resolved.

@Samillion

This comment was marked as resolved.

@houssemko

This comment was marked as resolved.

@Samillion
Copy link
Owner

Test script: compact_osc/modernz.lua
Commit: 058fb6e

Please test and let me know if there are any issues or changes that need to be made.

Changes:

  • Reduced bottomhover_zone to 130
  • Reduced time_font_size to 16
  • Reduced raise_subtitle_amount to 125
  • Reduced playpause_size to 28
  • Reduced fade_alpha to 130
  • Reduced possible OSC height to 140 and 100 (dependent on title function)
  • Moved chapter_title below title
  • Moved time stamps next to left side buttons
  • Moved cache_info next to right side buttons
  • Improved elements visibility based on window width

Pinging @Keith94 and @Xurdejl as they have shown interest in compact mode.

@da3dsoul1
Copy link

Wow, compact mode is so cool! Thanks!

@Keith94

This comment was marked as resolved.

@Samillion
Copy link
Owner

Updated: compact_osc/modernz.lua
Commit: 2ee659c

Changes:

  • Increase chapter_title font size and padding
  • Position title based on the existence of chapters to eliminate empty space with no chapters
  • Move side and middle buttons to be more symmetrically centered
  • Decrease volume bar width to 55

With chapter_title:
image

Without chapter_title:
image

If above change is made, the time can be moved to the left which creates more room.

Wouldn't this break "standard"? Most OSCs (local and online players) have [vol_icon] [vol_bar] [time] or move the volume bar all the way to the right.

I'm not rejecting this specific suggestion, I'm just concerned on user experience.

Do you think we should instead make the volume bar a user option? ie: show volume icon only if need be.

@Keith94

This comment was marked as resolved.

@Samillion

This comment was marked as outdated.

@Keith94

This comment was marked as resolved.

@Samillion
Copy link
Owner

Samillion commented Dec 26, 2024

Updated script. (Same link)
Commit: 52b77e6

Changes:

  • Increase chapter_title padding
  • Add as a chapter_title prefix

I tested them, that prefix is the only one that is kind of visible lol. Not sure if I should keep it or not, to be honest.

image

@Keith94

This comment was marked as resolved.

@Samillion

This comment was marked as resolved.

@Samillion
Copy link
Owner

Updated: compact_osc/modernz.lua
Commit: c75e35e

Changes:

  • Fix chapter_title 1 pixel offset
  • Improve chapter check for title position by checking user_opts.show_chapter_title as well
  • Remove chapter_title prefix

@da3dsoul1

This comment was marked as resolved.

@Samillion

This comment was marked as resolved.

@da3dsoul1

This comment was marked as resolved.

@Keith94

This comment was marked as resolved.

@Samillion

This comment was marked as resolved.

@Samillion

This comment was marked as resolved.

@Keith94

This comment was marked as resolved.

@Samillion

This comment was marked as outdated.

@Samillion

This comment was marked as resolved.

@xiaoleichen

This comment was marked as resolved.

@Samillion

This comment was marked as resolved.

@Samillion

This comment was marked as resolved.

@Samillion
Copy link
Owner

Samillion commented Dec 27, 2024

Updated: compact_osc/modernz.lua
Commit: 8331357

Changes:

  • Combined time codes into one element for consistency time_codes
  • Changed click functions on time code
    • Left click: show milliseconds (ms)
    • Right click: show remaining time
  • Display cache_info and cache_info_speed in two separate lines
  • Display cache_info correctly aligned if cache_info_speed is disabled
  • Remove Cache: label and use tool tip on hover instead locale.cache
  • Display current volume on hover with vol_ctrl icon

Untitled

@Samillion

This comment was marked as resolved.

@Keith94

This comment was marked as resolved.

@xiaoleichen

This comment was marked as resolved.

@xiaoleichen

This comment was marked as resolved.

@Samillion
Copy link
Owner

For local videos the cache speed isn't centered vertically. (Is such info useful for local videos?...hmm)

I asked the same question on the feature request for cache, and they said to enable for all types. I also only use cache speed for online videos only, so I enable it with my Stream auto profile

The height and width hit box for the new timecodes seem a tiny bit off. Needs more height and a little less width.

Will try to fix as best as I can.

The distance between cache info and the right buttons keeps changing as cached time and speed change. Since it's on the right side, would it be better to align to the right,

Great idea. I'll use an=6 (align right), looks much better that way.

image

Another suggestion: since it's using tc_left / tc_right format for time codes, can we make the tc_right always display total time and toggle tc_left for time played and time remaining?

The mpv users would crucify me if I did that lol. We can maybe introduce a feature in the future to customize time display behavior

@Samillion
Copy link
Owner

Updated: compact_osc/modernz.lua
Commit: 138e263

Changes:

  • Decrease total height of OSC to 130
  • Dynamically decrease height of OSC based on title or chapter_title existence/function with osc_height_offset
  • Improve time_codes hitbox height and width
  • Improve cache_info and cache_info_speed position and alignment
  • Reverse time_codes click functions

@Keith94
Copy link
Contributor

Keith94 commented Dec 28, 2024

Everything looks great. Except I'm a little confused. When cache info is enabled why does the cache time show up invisible on local videos?

image

@Samillion

This comment was marked as resolved.

@Samillion

This comment was marked as resolved.

@Keith94

This comment was marked as resolved.

@Samillion

This comment was marked as resolved.

@Samillion
Copy link
Owner

So cached time is not showing at all for you on local videos?

image

@Keith94
Copy link
Contributor

Keith94 commented Dec 28, 2024

So cached time is not showing at all for you on local videos?

Yeah, not at all.. It used to show just the speed properly and cache time was invisible. Commit 87478e5 made it so speed doesn't show up now. Feels like I made a simple mistake somewhere lol.

@Samillion
Copy link
Owner

Samillion commented Dec 28, 2024

Yeah, not at all.. It used to show just the speed properly and cache time was invisible. Commit 87478e5 made it so speed doesn't show up now. Feels like I made a simple mistake somewhere lol.

Hmmm. Could it be related to your cache options in mpv.conf? Mine is:

### Cache
cache=yes
demuxer-max-bytes=400MiB
demuxer-max-back-bytes=200MiB

Also, in my media auto profile it changes to:

[Media]
    profile-desc=Apply options for Movies and TV Shows directories
    profile-cond=get('path', ''):match('\\Movies\\') or get('path', ''):match('\\TV Shows\\') or get('path', ''):match('^X:\\')
    profile-restore=copy-equal
    demuxer-max-bytes=1500MiB
    demuxer-max-back-bytes=500MiB

@Keith94
Copy link
Contributor

Keith94 commented Dec 28, 2024

Ahh, thank you. You found my simple mistake.

I left mpv's cache option alone which defaults to auto. When I set it to yes I can see the cache finally.

I guess if you set yours to "auto" or "no" then you should be able to reproduce that tooltip over invisible cache thingy. Hopefully.

@Samillion
Copy link
Owner

I guess if you set yours to "auto" or "no" then you should be able to reproduce that tooltip over invisible cache thingy. Hopefully.

Good point. Tooltip should only show if cache is shown.

@Samillion
Copy link
Owner

Samillion commented Dec 28, 2024

Updated: compact_osc/modernz.lua
Commit: 245127d

Changes:

  • Display cache tooltip only if cache ranges exist.

@Keith94 I learned something new because of this bug. If you want to display cache_info for online only, then in mpv.conf set cache=auto

@Keith94
Copy link
Contributor

Keith94 commented Dec 28, 2024

That's great! 😎 I feel like modernz should follow that same setting, if possible. Don't show cache for local files unless you specifically have it on yes.

Edit; nvm, I think it may already be doing that. It's late.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request planned Implementation of this behavior will be added in the future
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants