First frame fix

This commit is contained in:
Utkarsh Verma
2022-05-06 16:54:26 +05:30
parent 97f5443291
commit 6f50a16857
2 changed files with 6 additions and 1 deletions

View File

@@ -41,6 +41,11 @@ module.exports = async options => {
if (error) { break }
}
// Set currentTime to duration / 2
// (fix for correctly invoking onseeked event for currentTime = 0 if the first frame is at 0 sec.)
video.currentTime = video.duration / 2;
await new Promise(resolve => { seekResolve = resolve; });
// Set options to default values if not set
fallbackToDefault('format', 'image/png')
fallbackToDefault('offsets', [])

View File

@@ -1,6 +1,6 @@
{
"name": "video-frames",
"version": "1.0.13",
"version": "1.0.14",
"private": false,
"description": "Client-side video frames extraction as base64 encoded images",
"author": "Utkarsh Verma",