{"id":14990164,"url":"https://github.com/daviddarnes/duration-property","last_synced_at":"2025-04-12T02:05:43.971Z","repository":{"id":216335450,"uuid":"729982775","full_name":"daviddarnes/duration-property","owner":"daviddarnes","description":"A Web Component to surface an audio or video's duration as a CSS Custom Property","archived":false,"fork":false,"pushed_at":"2024-11-14T12:06:47.000Z","size":16,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-12T02:05:37.132Z","etag":null,"topics":["component","components","customelement","customelements","webcomponent","webcomponents"],"latest_commit_sha":null,"homepage":"https://daviddarnes.github.io/duration-property/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-10T23:41:50.000Z","updated_at":"2025-03-28T14:18:33.000Z","dependencies_parsed_at":"2024-01-09T17:56:51.250Z","dependency_job_id":"f8ece652-3cb7-48b7-a2e2-1978b8e53265","html_url":"https://github.com/daviddarnes/duration-property","commit_stats":null,"previous_names":["daviddarnes/duration-property"],"tags_count":2,"template":false,"template_full_name":"daviddarnes/component-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fduration-property","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fduration-property/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fduration-property/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fduration-property/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daviddarnes","download_url":"https://codeload.github.com/daviddarnes/duration-property/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505863,"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.598Z","updated_at":"2025-04-12T02:05:43.941Z","avatar_url":"https://github.com/daviddarnes.png","language":"HTML","funding_links":["https://buymeacoffee.com/daviddarnes"],"categories":[],"sub_categories":[],"readme":"# `duration-property`\n\nA Web Component to surface an audio or video's duration as a CSS Custom Property.\n\n**[Demo](https://daviddarnes.github.io/duration-property/demo.html)** | **[Further reading](https://darn.es/duration-property-web-component/)**\n\n## Examples\n\n```html\n\u003cscript type=\"module\" src=\"duration-property.js\"\u003e\u003c/script\u003e\n\n\u003cduration-property\u003e\n  \u003caudio controls src=\"https://darn.es/sounds/daviddarnes.m4a\"\u003e\u003c/audio\u003e\n\u003c/duration-property\u003e\n```\n\n## Features\n\nThis Web Component allows you to:\n\n- Surface the duration of an audio or video elements source duration as a CSS Custom Property (`--duration`)\n- Update the `--duration` custom property if the duration of the source changes\n\n## Installation\n\nYou have a few options (choose one of these):\n\n1. Install via [npm](https://www.npmjs.com/package/@daviddarnes/duration-property): `npm install @daviddarnes/duration-property`\n1. [Download the source manually from GitHub](https://github.com/daviddarnes/duration-property/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=\"duration-property.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/duration-property@1.0.0/duration-property.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/duration-property@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%2Fduration-property","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaviddarnes%2Fduration-property","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaviddarnes%2Fduration-property/lists"}