Skip to content

Commit a803484

Browse files
authored
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.
1 parent a0d09c1 commit a803484

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/js/tech/html5.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class Html5 extends Tech {
5454
this.setupSourcesetHandling_();
5555
}
5656

57+
this.isScrubbing_ = false;
58+
5759
if (this.el_.hasChildNodes()) {
5860

5961
const nodes = this.el_.childNodes;
@@ -537,6 +539,17 @@ class Html5 extends Tech {
537539
this.isScrubbing_ = isScrubbing;
538540
}
539541

542+
/**
543+
* Get whether we are scrubbing or not.
544+
*
545+
* @return {boolean} isScrubbing
546+
* - true for we are currently scrubbing
547+
* - false for we are no longer scrubbing
548+
*/
549+
scrubbing() {
550+
return this.isScrubbing_;
551+
}
552+
540553
/**
541554
* Set current time for the `HTML5` tech.
542555
*

src/js/tech/tech.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,15 @@ class Tech extends Component {
501501
*/
502502
setScrubbing() {}
503503

504+
/**
505+
* Get whether we are scrubbing or not
506+
*
507+
* @abstract
508+
*
509+
* @see {Html5#scrubbing}
510+
*/
511+
scrubbing() {}
512+
504513
/**
505514
* Causes a manual time update to occur if {@link Tech#manualTimeUpdatesOn} was
506515
* previously called.

0 commit comments

Comments
 (0)