Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
use stream.skip_seconds when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
vixalien committed Dec 24, 2023
1 parent 0c5ef91 commit f39eafa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,12 @@ export class APPlayerState extends Adw.Bin {
const unit = controller.get_unit();

if (unit === Gdk.ScrollUnit.WHEEL) {
delta = (dx === 0 ? dy : dx) * 10000000;
delta = (dx === 0 ? dy : dx) * 10;
} else {
delta = (dx === 0 ? dy : dx) * 1000000;
delta = dx === 0 ? dy : dx;
}

const d = Math.max(Math.min(stream.timestamp - delta, stream.duration), 0);
stream.seek(d);
stream.skip_seconds(delta);
}

private key_pressed_cb(
Expand Down

0 comments on commit f39eafa

Please sign in to comment.