{"id":14990160,"url":"https://github.com/daviddarnes/sample-input","last_synced_at":"2025-07-30T13:06:52.040Z","repository":{"id":215661188,"uuid":"730299720","full_name":"daviddarnes/sample-input","owner":"daviddarnes","description":"A Web Component to sample audio or video added to an upload input","archived":false,"fork":false,"pushed_at":"2024-04-15T10:27:26.000Z","size":17,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T02:05:45.587Z","etag":null,"topics":["component","components","customelement","customelements","webcomponent","webcomponents"],"latest_commit_sha":null,"homepage":"https://daviddarnes.github.io/sample-input/demo.html","language":"HTML","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/daviddarnes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"buy_me_a_coffee":"daviddarnes"}},"created_at":"2023-12-11T16:15:46.000Z","updated_at":"2024-08-13T00:49:37.000Z","dependencies_parsed_at":"2024-04-15T11:48:44.777Z","dependency_job_id":"85429450-fa30-478f-91fa-50e47c726a53","html_url":"https://github.com/daviddarnes/sample-input","commit_stats":null,"previous_names":["daviddarnes/sample-input"],"tags_count":2,"template":false,"template_full_name":"daviddarnes/component-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fsample-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fsample-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fsample-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fsample-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daviddarnes","download_url":"https://codeload.github.com/daviddarnes/sample-input/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505862,"owners_count":21115354,"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":["component","components","customelement","customelements","webcomponent","webcomponents"],"created_at":"2024-09-24T14:19:38.335Z","updated_at":"2025-04-12T02:05:53.474Z","avatar_url":"https://github.com/daviddarnes.png","language":"HTML","funding_links":["https://buymeacoffee.com/daviddarnes"],"categories":[],"sub_categories":[],"readme":"# `sample-input`\n\nA Web Component to sample audio or video added to an upload input\n\n**[Demo](https://daviddarnes.github.io/sample-input/demo.html)** | **[Further reading](https://darn.es/sample-input-web-component/)**\n\n## Examples\n\nGeneral usage example:\n\n```html\n\u003cscript type=\"module\" src=\"sample-input.js\"\u003e\u003c/script\u003e\n\n\u003csample-input\u003e\n  \u003cinput aria-controls=\"preview\" type=\"file\"\u003e\n  \u003caudio id=\"preview\" aria-live=\"polite\" controls\u003e\u003c/audio\u003e\n\u003c/sample-input\u003e\n```\n\nExample usage with the `capture` option to record live audio (not compatible with all hardware) and placeholder audio:\n\n```html\n\u003cscript type=\"module\" src=\"sample-input.js\"\u003e\u003c/script\u003e\n\n\u003csample-input\u003e\n  \u003cinput aria-controls=\"preview\" type=\"file\" accept=\"audio/*\" capture\u003e\n  \u003caudio id=\"preview\" aria-live=\"polite\" controls src=\"https://darn.es/sounds/daviddarnes.m4a\"\u003e\u003c/audio\u003e\n\u003c/sample-input\u003e\n```\n\n## Features\n\nThis Web Component allows you to:\n\n- Add an audio or video file that's been added via an upload input to an `audio` or `video` element so it can be previewed\n\n## Installation\n\nYou have a few options (choose one of these):\n\n1. Install via [npm](https://www.npmjs.com/package/@daviddarnes/sample-input): `npm install @daviddarnes/sample-input`\n1. [Download the source manually from GitHub](https://github.com/daviddarnes/sample-input/releases) into your project.\n1. Skip this step and use the script directly via a 3rd party CDN (not recommended for production use)\n\n### Usage\n\nMake sure you include the `\u003cscript\u003e` in your project (choose one of these):\n\n```html\n\u003c!-- Host yourself --\u003e\n\u003cscript type=\"module\" src=\"sample-input.js\"\u003e\u003c/script\u003e\n```\n\n```html\n\u003c!-- 3rd party CDN, not recommended for production use --\u003e\n\u003cscript type=\"module\" src=\"https://www.unpkg.com/@daviddarnes/sample-input@1.0.0/sample-input.js\"\u003e\u003c/script\u003e\n```\n\n```html\n\u003c!-- 3rd party CDN, not recommended for production use --\u003e\n\u003cscript type=\"module\" src=\"https://esm.sh/@daviddarnes/sample-input@1.0.0\"\u003e\u003c/script\u003e\n```\n\n## Credit\n\nWith thanks to the following people:\n\n- [Zach Leatherman](https://zachleat.com) for inspiring this [Web Component repo template](https://github.com/daviddarnes/component-template)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaviddarnes%2Fsample-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaviddarnes%2Fsample-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaviddarnes%2Fsample-input/lists"}