Skip to content

Comments

add autostart button to videoplayer#6368

Merged
WithoutPants merged 13 commits intostashapp:developfrom
cj12312021:add-autoplay-button-on-video-player
Dec 10, 2025
Merged

add autostart button to videoplayer#6368
WithoutPants merged 13 commits intostashapp:developfrom
cj12312021:add-autoplay-button-on-video-player

Conversation

@cj12312021
Copy link
Collaborator

This pull request adds the auto-start button, which was previously behind the interface settings, directly to the video player, similar to most modern video players.

@cj12312021 cj12312021 marked this pull request as draft December 3, 2025 06:15
@DogmaDragon

This comment was marked as outdated.

@cj12312021
Copy link
Collaborator Author

Still working on this PR. I planned on providing screenshots once I've polished the styling

@cj12312021
Copy link
Collaborator Author

I've gotten the CSS to a point I'm happy with. Here are pictures.

Acfive state:
Screenshot 2025-12-03 012029

Disabled state:
Screenshot 2025-12-03 011951

I would like to eventually create sections within the settings button where buttons such as the playback options can be tucked into. But that's a separate conversation. I'll address the remaining linter issues tomorrow.

@cj12312021 cj12312021 added the ui Issues related to UI label Dec 3, 2025
@DogmaDragon
Copy link
Collaborator

I like it. I have 2 questions.

  1. Does the button have alt text? Most ofter buttons do (with the exception of the wheel) and I think it would add some clarity without any downsides.
  2. Will it properly work with Settings > Interface > Scene Player > Auto-start video and Auto-start video when playing selected toggles?

@cj12312021 cj12312021 marked this pull request as ready for review December 3, 2025 16:49
@cj12312021
Copy link
Collaborator Author

cj12312021 commented Dec 3, 2025

This PR should be ready for a review now.

@DogmaDragon

Does the button have alt text? Most ofter buttons do (with the exception of the wheel) and I think it would add some clarity without any downsides.

Yes, this new button also display descriptive text on hover. Trying to capture a screenshot of this while keep the text on screen proved difficult but here is the code:

    if (this.autostartEnabled) {
      this.addClass("vjs-icon-play-circle");
      this.controlText(this.localize("Auto-start enabled (click to disable)"));
    } else {
      this.addClass("vjs-icon-cancel");
      this.controlText(this.localize("Auto-start disabled (click to enable)"));
    }

The Auto-start enabled (click to disable) text will display on hover when the button is currently enabled. The Auto-start disabled (click to enable) text will display on hover when the button is disabled.

Will it properly work with Settings > Interface > Scene Player > Auto-start video and Auto-start video when playing selected toggles?

Yes, the code will sync all toggle actions between the video player button as well as settings interface button.

Copy link
Collaborator

@WithoutPants WithoutPants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The styling needs to be adjusted for viewports between 577px and 700px. The cog icon and full screen buttons end up chopped off:

Image


if (this.autostartEnabled) {
this.addClass("vjs-icon-play-circle");
this.controlText(this.localize("Auto-start enabled (click to disable)"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we accept localised strings in the constructor options instead? That way we could put the strings into the localisation files.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was interesting. I saw we did localization this way for some of the other VideoJS buttons. I kept the approach for consistency, but I could add a localised string here if you don't mind the inconsistency.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. Leave it as is for consistency. We should address localisation in another PR.

@cj12312021
Copy link
Collaborator Author

The styling needs to be adjusted for viewports between 577px and 700px. The cog icon and full-screen buttons end up chopped off

What are your thoughts on hiding the auto-play button for now on mobile until button consolidation has been done? The button overload is more apparent on mobile

@WithoutPants
Copy link
Collaborator

What are your thoughts on hiding the auto-play button for now on mobile until button consolidation has been done? The button overload is more apparent on mobile

Sounds good

}

// make controls a little more compact on smaller screens
@media (max-width: 576px) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The buttons are still currently overflowing offscreen between 576px and ~676px width. I reckon it would make sense to change this clause to (max-width: 768px) and move the hide autostart button to a separate (max-width: 576px) clause.

This is with that fix at 600px width:
Image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm just seeing your message. I'm currently unable to test the change, but I've applied the update as you've mentioned.

@WithoutPants WithoutPants merged commit fe41561 into stashapp:develop Dec 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui Issues related to UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants