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

fix(player): reset CSS classes at player.reset #8487

Merged

Conversation

amtins
Copy link
Contributor

@amtins amtins commented Nov 10, 2023

Description

Allows CSS classes to be reset when player.reset is called, so that the player is close to its initial state.

Specific Changes proposed

  • remove vjs-playing
  • add vjs-paused

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chrome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
  • Reviewed by Two Core Contributors

Copy link

codecov bot commented Nov 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7972c23) 82.71% compared to head (c1e4790) 82.71%.

❗ Current head c1e4790 differs from pull request most recent head da12821. Consider uploading reports for the commit da12821 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8487      +/-   ##
==========================================
- Coverage   82.71%   82.71%   -0.01%     
==========================================
  Files         113      113              
  Lines        7592     7591       -1     
  Branches     1826     1826              
==========================================
- Hits         6280     6279       -1     
  Misses       1312     1312              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/js/player.js Outdated
@@ -3599,6 +3599,11 @@ class Player extends Component {
if (this.tech_) {
this.tech_.clearTracks('text');
}

this.removeClass('vjs-playing');
this.removeClass('vjs-has-started');
Copy link
Member

Choose a reason for hiding this comment

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

the others make sense but I don't think we want to remove this one. Yes, the player is reset, but it should still be in started state, could be a breaking change, potentially as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gkatsev thank you for taking the time to review this PR and for the feedback. I removed this.removeClass('vjs-has-started');

@amtins amtins force-pushed the fix/player-el-reset-classlist branch from fb83d87 to c1e4790 Compare November 11, 2023 15:44
Allows CSS classes to be reset when `player.reset` is called,
so that the player is close to its initial state.

- remove `vjs-playing`
- add `vjs-paused`
@amtins amtins force-pushed the fix/player-el-reset-classlist branch from c1e4790 to da12821 Compare November 29, 2023 09:08
@dzianis-dashkevich dzianis-dashkevich merged commit 849098f into videojs:main Dec 4, 2023
7 of 8 checks passed
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.

None yet

4 participants