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

Moving seekbar event handler bindings into a function #5097

Merged

Conversation

guided1
Copy link
Contributor

@guided1 guided1 commented Apr 13, 2018

Description

Move all eventHandler bindings into a function.

Specific Changes proposed

This allows for easier customisation of the the seekbar component.
If you extend the seekbar component you can choose to override setEventHandlers_ or keep it default.

If you do override setEventHandlers_ and call super() in the constructor, you get your own event handlers + the functionality provided by Slider

Currently extending slider and wanting different bindings, means either copy pasting from the existing slider or writing a function to undo the bindings (which is not possible in this case since they are anonymous functions).

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 (Chome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
  • Reviewed by Two Core Contributors

 - Makes it easier to extend the seekbar and change modify the default event handlers

no message
@guided1
Copy link
Contributor Author

guided1 commented Apr 13, 2018

Assuming this gets in, will this and #5055 make it into 6.x or are these only for 7.x?

Is there anything I need to do for them to get into 6.x?

@guided1 guided1 changed the title Moving event handlers into a function Moving seekbar event handlers into a function Apr 13, 2018
@guided1 guided1 changed the title Moving seekbar event handlers into a function Moving seekbar event handler bindings into a function Apr 13, 2018
Copy link
Member

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

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

Seems like a reasonable change.

*
* @private
*/
setEventHandlers_(player, options) {
Copy link
Member

Choose a reason for hiding this comment

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

I would consider removing passing in the player and options and instead update the code to use this.player_ and this.options_

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure thing.

 - Using member variables instead of passing through arguments.
Copy link
Member

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

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

Thanks!

@gkatsev gkatsev added the needs: LGTM Needs one or more additional approvals label Apr 17, 2018
@gkatsev gkatsev added confirmed and removed needs: LGTM Needs one or more additional approvals labels Apr 19, 2018
@gkatsev gkatsev merged commit 1069e7f into videojs:master Apr 19, 2018
gkatsev pushed a commit that referenced this pull request Apr 19, 2018
Makes it easier to extend the seekbar and change the default event handlers. If you extend the seekbar component you can choose to override setEventHandlers_ or keep it default. If you do override setEventHandlers_ and call super() in the constructor, you get your own event handlers + the functionality provided by Slider.
gkatsev pushed a commit that referenced this pull request Apr 20, 2018
Makes it easier to extend the seekbar and change the default event handlers. If you extend the seekbar component you can choose to override setEventHandlers_ or keep it default. If you do override setEventHandlers_ and call super() in the constructor, you get your own event handlers + the functionality provided by Slider.
@gkatsev gkatsev mentioned this pull request Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants