1
0
mirror of https://github.com/videojs/video.js.git synced 2025-03-29 22:07:10 +02:00

feat(tech): add a scrubbing getter. (#6920)

This is helpful for source handlers and anything else that could have
customer behavior for when we're scrubbing or not.
This commit is contained in:
Gary Katsevman 2020-11-10 18:10:04 -05:00 committed by GitHub
parent a0d09c107a
commit a803484a39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -54,6 +54,8 @@ class Html5 extends Tech {
this.setupSourcesetHandling_();
}
this.isScrubbing_ = false;
if (this.el_.hasChildNodes()) {
const nodes = this.el_.childNodes;
@ -537,6 +539,17 @@ class Html5 extends Tech {
this.isScrubbing_ = isScrubbing;
}
/**
* Get whether we are scrubbing or not.
*
* @return {boolean} isScrubbing
* - true for we are currently scrubbing
* - false for we are no longer scrubbing
*/
scrubbing() {
return this.isScrubbing_;
}
/**
* Set current time for the `HTML5` tech.
*

View File

@ -501,6 +501,15 @@ class Tech extends Component {
*/
setScrubbing() {}
/**
* Get whether we are scrubbing or not
*
* @abstract
*
* @see {Html5#scrubbing}
*/
scrubbing() {}
/**
* Causes a manual time update to occur if {@link Tech#manualTimeUpdatesOn} was
* previously called.