Skip to content

Commit 610072c

Browse files
authored
fix duration update, add note on pip install via github repo instead of pypi (#30)
1 parent 8804468 commit 610072c

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ or higher installed. Then you can do the following (in a virtual environment
1212
if you want) in a terminal:
1313

1414
```
15-
pip install lingua-loop
15+
pip install git+https://github.com/jfdev001/lingua-loop.git
1616
```
1717

1818
You can launch the app, which will automatically open a web browser, by doing
@@ -54,8 +54,12 @@ $$
5454
you would receive a score of 0.70 because, despite the error, there are common
5555
characters that you correctly typed.
5656

57+
Note that this package is an alpha state and subject to breaking changes and
58+
bug fixes. Please open a GitHub issue if you encounter problems!
59+
5760
# Future Work
5861

62+
5963
Some possible extension ideas:
6064

6165
1. Significantly improve the styling.

src/lingua_loop/static/app.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,16 @@ window.addEventListener("DOMContentLoaded", async () => {
243243
current = state.player.getCurrentTime();
244244
}
245245

246+
const duration = state.player.getDuration()
247+
if (!isNaN(duration) && duration != 0) {
248+
videoConfiguration.duration = duration;
249+
document.getElementById("duration").textContent = formatTime(
250+
videoConfiguration.duration);
251+
}
252+
246253
document.getElementById("currentTime").textContent = formatTime(current);
247254
videoConfiguration.seekBar.value = (current / videoConfiguration.duration) * 100;
255+
248256
updateSliderFill(videoConfiguration.seekBar);
249257
return;
250258
}

0 commit comments

Comments
 (0)