Skip to content

Commit

Permalink
Fixed long laod time
Browse files Browse the repository at this point in the history
  • Loading branch information
KuntilBogel committed Jul 10, 2024
1 parent 33bea83 commit 7ce1032
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Player
Install webpack as global and then run ```webpack --watch```
2 changes: 1 addition & 1 deletion dist/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion dist/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ let subtitle = params.get("subtitlelink"),
started = false
if (vid_link) {
document.querySelector("#main_vid").src = vid_link;
fetch(vid_link).then(response => {
fetch(vid_link, { method: 'HEAD' }).then(response => {
if (!response.ok) throw new Error(response.status);
}).catch(e => {
JSAlert.alert(e + "\nWhile loading video", null, JSAlert.Icons.Failed);
document.querySelector("#main_vid").src = backup_vidlink
})
}

let vidhash = (await sha256(vid_link)).slice(0, 10)
if (subtitle) {
fetch(subtitle).then(async p => {
Expand Down
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@
</div>
</div>
</body>
<style>
.container {
margin: auto auto;
max-width: 87.5%;
}
</style>
</html>

0 comments on commit 7ce1032

Please sign in to comment.