Skip to content

Commit

Permalink
Merge pull request #118 from vlitejs/fix/preload-html5
Browse files Browse the repository at this point in the history
Fix preload on html5 provider
  • Loading branch information
yoriiis authored Feb 13, 2024
2 parents e990053 + 0ff76f1 commit 5fbb532
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/providers/html5/html5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ export default function Html5Provider(Player: any) {
*/
waitUntilVideoIsReady(): Promise<any> {
return new window.Promise<void>((resolve) => {
if (this.media.readyState >= 2 && this.media.duration) {
if (
(this.media.readyState >= 2 && this.media.duration) ||
(this.media.readyState === 0 && this.media.preload === 'none')
) {
resolve()
} else {
// Listen both events
Expand Down

0 comments on commit 5fbb532

Please sign in to comment.