Made the media player more responsive and accurate. (#95)

This commit is contained in:
Jas Singh
2024-08-07 23:25:28 -07:00
committed by GitHub
parent 407c8aa304
commit 87d661021d
4 changed files with 56 additions and 34 deletions

View File

@@ -23,7 +23,7 @@ const Bar = (getPlayerInfo: Function) => {
const update = () => {
const foundPlayer = getPlayerInfo(media);
if (foundPlayer !== undefined) {
const value = foundPlayer.position / foundPlayer.length;
const value = foundPlayer.length ? foundPlayer.position / foundPlayer.length : 0;
self.value = value > 0 ? value : 0;
} else {
self.value = 0;