Skip to content

Commit

Permalink
fix playback speed issue on certain detected media
Browse files Browse the repository at this point in the history
  • Loading branch information
Quantizr authored Mar 9, 2023
1 parent 6ac09af commit 51e2e9c
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/contents/lib/SpeedController.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import debugging from "debug"
import inspectMediaElements from "./inspectMediaElements"

import type { MediaElement } from "../../shared/types"

Expand Down Expand Up @@ -100,18 +101,7 @@ export default class SpeedController {
}

setPlaybackRate(rate: number) {
this.elements = [
...document.querySelectorAll("video, audio")
] as MediaElement[]
debug(
"Setting playback rate to",
rate,
"on",
this.elements.length,
"elements"
)

this.elements.forEach((element) => {
inspectMediaElements((element: MediaElement) => {
this.setPlaybackRateForElement(rate, element)
})
}
Expand Down

0 comments on commit 51e2e9c

Please sign in to comment.