{"id":13790071,"url":"https://github.com/zzarcon/video-snapshot","last_synced_at":"2025-04-09T23:15:49.734Z","repository":{"id":29126610,"uuid":"120285098","full_name":"zzarcon/video-snapshot","owner":"zzarcon","description":"Get snapshots from a video file in the browser :movie_camera: :sunrise:","archived":false,"fork":false,"pushed_at":"2022-12-10T17:04:32.000Z","size":35578,"stargazers_count":92,"open_issues_count":37,"forks_count":16,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T23:15:41.996Z","etag":null,"topics":["browser","canvas","capture","preview","screenshot","snapshot","thumbnail","video"],"latest_commit_sha":null,"homepage":"https://zzarcon.github.io/video-snapshot","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zzarcon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-05T09:46:23.000Z","updated_at":"2025-02-25T15:51:02.000Z","dependencies_parsed_at":"2023-01-14T14:15:24.325Z","dependency_job_id":null,"html_url":"https://github.com/zzarcon/video-snapshot","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzarcon%2Fvideo-snapshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzarcon%2Fvideo-snapshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzarcon%2Fvideo-snapshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zzarcon%2Fvideo-snapshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zzarcon","download_url":"https://codeload.github.com/zzarcon/video-snapshot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125592,"owners_count":21051770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","canvas","capture","preview","screenshot","snapshot","thumbnail","video"],"created_at":"2024-08-03T22:00:36.612Z","updated_at":"2025-04-09T23:15:49.699Z","avatar_url":"https://github.com/zzarcon.png","language":"TypeScript","funding_links":[],"categories":[":clap: 欢迎参与​"],"sub_categories":["工具库"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"video-snapshot.gif\" alt=\"Logo\" height=\"400\"\u003e\n  \u003cbr\u003e\u003cbr\u003e\n\u003c/div\u003e\n\n# video-snapshot [![Build Status](https://travis-ci.org/zzarcon/video-snapshot.svg?branch=master)](https://travis-ci.org/zzarcon/video-snapshot)\n\u003e Get snapshots from a video file in the browser\n\n# Demo 💅\n[https://zzarcon.github.io/video-snapshot](https://zzarcon.github.io/video-snapshot)\n\n# Install 🚀\n\n```\n$ yarn add video-snapshot\n```\n\n# Usage ⛏\n\n```javascript\nimport VideoSnapshot from 'video-snapshot';\n\ndocument.querySelector('input[type=\"file\"]').addEventListener('change', onChange);\n\nconst onChange = async (e) =\u003e {\n  const snapshoter = new VideoSnapshot(e.target.files[0]);\n  const previewSrc = await snapshoter.takeSnapshot();\n  const img = document.createElement('img');\n\n  img.src = previewSrc;\n\n  document.body.appendChild(img);\n};\n```\n\n# Api 👀\n\n```typescript\ntype CustomVideoTime = 'start' | 'middle' | 'end';\ntype VideoTime = number | CustomVideoTime;\n\nclass VideoSnapshot {\n  constructor(blob: Blob) {};\n  takeSnapshot(time?: VideoTime): Promise\u003cstring\u003e;\n  end(): void;\n}\n```\n\n# Features 💸\n\n* Dependency free\n* [2kb size](https://bundlephobia.com/result?p=video-snapshot@1.0.1)\n* Take snapshot at any time\n* You can pass **smart times** to easily get better previews\n\n# Author 🦄\n\n[@zzarcon](https://twitter.com/zzarcon)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzarcon%2Fvideo-snapshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzzarcon%2Fvideo-snapshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzzarcon%2Fvideo-snapshot/lists"}