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

Make 'scrubbing' an official property #1766

Closed
heff opened this issue Dec 22, 2014 · 2 comments
Closed

Make 'scrubbing' an official property #1766

heff opened this issue Dec 22, 2014 · 2 comments

Comments

@heff
Copy link
Member

heff commented Dec 22, 2014

As a follow up to #1741, scrubbing should become an official player API property. Currently the progress bar sets player.scrubbing = true, and if we change that now it could break external control bars, so this should wait for 5.0.

Here's the code to make it happen. The progress bar will need to be updated.

/**
 * Store the internal state of scrubbing
 * @private
 * @return {Boolean} True if the user is scrubbing
 */
vjs.Player.prototype.scrubbing_ = false;


/**
 * Returns whether or not the user is "scrubbing". Scrubbing is when the user 
 * has clicked the progress bar handle and is dragging it along the progress bar.
 * @param  {Boolean} isScrubbing   True/false the user is scrubbing
 * @return {Boolean}               The scrubbing status when getting
 * @return {Object}                The player when setting
 */
vjs.Player.prototype.scrubbing = function(isScrubbing){
  if (isScrubbing !== undefined) {
    this.scrubbing_ = !!isScrubbing;

    if (isScrubbing) {
      this.addClass('vjs-scrubbing');
    } else {
      this.removeClass('vjs-scrubbing');
    }

    return this; 
  }

  return this.scrubbing_;
};
@forbesjo
Copy link
Contributor

Looking at this

@heff
Copy link
Member Author

heff commented Apr 28, 2015

Closed by #2080

@heff heff closed this as completed Apr 28, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants