scrolly-video
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -140,2 +140,8 @@ import UAParser from 'ua-parser-js'; | ||
); | ||
} else { | ||
this.video.addEventListener( | ||
'loadedmetadata', | ||
() => this.setTargetTimePercent(0, true), | ||
{ once: true }, | ||
); | ||
} | ||
@@ -205,2 +211,10 @@ | ||
videoDecoder(this.src, (frame) => { this.frames.push(frame); }, this.debug) | ||
.catch(() => { | ||
if (this.debug) console.error('Error encountered while decoding video'); | ||
// Remove all decoded frames if a failure happens during decoding | ||
this.frames = []; | ||
// Force a video reload when videoDecoder fails | ||
this.video.load(); | ||
}) | ||
.then(() => { | ||
@@ -207,0 +221,0 @@ // If no frames, something went wrong |
{ | ||
"name": "scrolly-video", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A component for scroll-based (or other externally controlled) playback.", | ||
@@ -5,0 +5,0 @@ "main": "dist/scrolly-video.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
10625689
10853