diff --git a/CHANGELOG.md b/CHANGELOG.md index 54f3d948..c03d5fb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## 6.0.4 + +### Fixes + +- Fix duration when preload is disabled ([#135](https://github.com/vlitejs/vlite/pull/135)) + ## 6.0.3 ### Fixes diff --git a/package-lock.json b/package-lock.json index a1ea13c8..1b5e4e08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vlitejs", - "version": "6.0.3", + "version": "6.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vlitejs", - "version": "6.0.3", + "version": "6.0.4", "license": "MIT", "dependencies": { "validate-target": "^3.1.1" diff --git a/package.json b/package.json index b52aabd2..f97bfc40 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vlitejs", - "version": "6.0.3", + "version": "6.0.4", "description": "vLitejs is a fast and lightweight Javascript library for customizing video and audio player in Javascript with a minimalist theme (HTML5, Youtube, Vimeo, Dailymotion)", "keywords": [ "video", diff --git a/src/core/player.ts b/src/core/player.ts index 8809a861..ba53a5e6 100644 --- a/src/core/player.ts +++ b/src/core/player.ts @@ -203,12 +203,21 @@ export default class Player { this.Vlitejs.onReady instanceof Function && this.Vlitejs.onReady.call(this, this) // Call the onReady functions of components + if (this.media.preload === 'none' && this.Vlitejs.provider === 'html5') { + this.media.addEventListener('loadedmetadata', () => { + this.triggerOnReady() + }) + } else { + this.triggerOnReady() + } + this.loading(false) + } + + triggerOnReady() { this.options.controls && this.controlBar.onReady() Object.keys(this.plugins).forEach((id) => { this.plugins[id].onReady instanceof Function && this.plugins[id].onReady() }) - - this.loading(false) } /**