{"id":42260002,"url":"https://github.com/npm-workbench/react-create-html-video","last_synced_at":"2026-05-29T06:01:17.771Z","repository":{"id":334839473,"uuid":"1142459693","full_name":"NPM-Workbench/react-create-html-video","owner":"NPM-Workbench","description":"A lightweight React component that programmatically generates and plays an HTML video element with a clean, reusable API. This library does not rely on CSS-in-JS, with styles are intentionally kept minimal. Created with Typescript support.","archived":false,"fork":false,"pushed_at":"2026-05-26T04:54:42.000Z","size":173330,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-26T06:29:19.348Z","etag":null,"topics":["github-actions","html-video","html-video-background","mp4-video","npm-provenance","react-html-video","typescript-support","webm-video"],"latest_commit_sha":null,"homepage":"https://npm-workbench.github.io/react-create-html-video/","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/NPM-Workbench.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-26T12:49:02.000Z","updated_at":"2026-05-26T04:46:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/NPM-Workbench/react-create-html-video","commit_stats":null,"previous_names":["npm-workbench/react-create-html-video"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/NPM-Workbench/react-create-html-video","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NPM-Workbench%2Freact-create-html-video","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NPM-Workbench%2Freact-create-html-video/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NPM-Workbench%2Freact-create-html-video/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NPM-Workbench%2Freact-create-html-video/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NPM-Workbench","download_url":"https://codeload.github.com/NPM-Workbench/react-create-html-video/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NPM-Workbench%2Freact-create-html-video/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33639055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["github-actions","html-video","html-video-background","mp4-video","npm-provenance","react-html-video","typescript-support","webm-video"],"created_at":"2026-01-27T06:00:54.159Z","updated_at":"2026-05-29T06:01:17.751Z","avatar_url":"https://github.com/NPM-Workbench.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![component-preview-compressed](https://github.com/user-attachments/assets/2f791123-8aa4-4118-b031-a087fcd70ebf)\n![npm](https://img.shields.io/npm/v/react-create-html-video)\n![downloads](https://img.shields.io/npm/dw/react-create-html-video)\n![license](https://img.shields.io/npm/l/react-create-html-video)\n![NPM Unpacked Size](https://img.shields.io/npm/unpacked-size/react-click-image-play-youtube-video)\n![Security Policy](https://img.shields.io/badge/security-policy-brightgreen)\n![npm_provenance](https://img.shields.io/badge/npm-provenance-brightgreen?logo=npm)\n\n## React Create HTML Video\n\nA lightweight React component that programmatically generates and plays an HTML `\u003cvideo\u003e` element with a clean, reusable API. This library does not rely on CSS-in-JS, with styles are intentionally kept minimal. Created with Typescript support.\n\n### 📦 Installation\n\n```console\nnpm install react-create-html-video\n```\n\n### 🎲 Features\n\n1. Built for modern React with support for Typescript\n2. A lightweight API surface that is easy to understand\n3. Helps render a native HTML `\u003cvideo\u003e` element on the browser\n4. Provides support for MP4 and Webm based Video displays\n5. No manual CSS import is required — styles are bundled with the package.\n\n### 📄 API Type Signature\n\n```javascript\nexport type TReactCreateHTMLVideo = {\n  mp4: string;\n  webm: string;\n};\n```\n\n### 🤝 Peer Dependencies\n\n```javascript\n\"peerDependencies\": {\n  \"react\": \"\u003e=18\",\n  \"react-dom\": \"\u003e=18\"\n}\n```\n\n### 🧪 How This Works\n\n1. Detects browser support using `HTMLVideoElement.canPlayType`\n2. Prefers MP4 if supported\n3. Falls back to WebM if MP4 is unavailable\n4. Disables video rendering on Internet Explorer\n5. Returns `null` when no supported format is available\n\n### 🔤 Example Usage\n\n```javascript\n/* node modules */\nimport { ReactCreateHTMLVideo } from \"react-create-html-video\";\n\n/* module */\nfunction UIComponent() {\n  return (\n    {/* make sure your parent container is positioned: relative, imagine here min-height of 100vh */}\n    \u003cdiv className=\"heroSection positionRelative\"\u003e\n      \u003cReactCreateHTMLVideo\n        mp4=\"/path/to/mp4/video.mp4\"\n        webm=\"/path/to/webm/video.webm\"\n      /\u003e\n    \u003c/div\u003e\n  )\n}\n\n/* exports */\nexport default UIComponent;\n```\n\n### 📗 Test Coverage\n\n```\nPASS  src/video-component/test/index.test.tsx\n  RCHV Test Suite:\n    ✓ renders null when videoSource is null\n    ✓ renders video container when videoSource is provided\n    ✓ renders video element with correct attributes\n    ✓ sets video src to the videoSource from useVideo hook\n    ✓ passes correct props to useVideo hook\n    ✓ memoizes component and does not re-render with same props\n    ✓ renders video element inside parent container\n    ✓ updates when videoSource changes\n    ✓ returns null when videoSource is falsy\n    ✓ renders only one video element\n```\n\n```\n-----------|---------|----------|---------|---------|-------------------\nFile       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s\n-----------|---------|----------|---------|---------|-------------------\nAll files  |     100 |      100 |     100 |     100 |\n index.tsx |     100 |      100 |     100 |     100 |\n-----------|---------|----------|---------|---------|-------------------\n```\n\n\u003cbr/\u003e🎯 **Note:** Release(s) 1.4.x has fixed issues related to react-dedup. It was found that inspite of being a react client side component, an error related to ```Cannot read properties of undefined (reading 'ReactCurrentDispatcher')``` was coming up. You can now install this package directly. If issues still persist, please do raise a github issue along with screenshots and comments for me to work on.\n\n### 📘 Contributing\n\nContributions, suggestions, and improvements are welcome.\u003cbr/\u003e\nFeel free to open issues or pull requests.\n\n### 🔒 Security \u0026 Privacy\n\n1. This package is open source and designed as a lightweight client-side React component. It does not collect, store, sell, or share user data, and it does not include analytics, tracking, telemetry, cookies, local storage usage, backend services, or project-owned data collection systems.\n2. For more details, including vulnerability reporting guidance and consumer security recommendations, please see the [Security Policy](https://github.com/NPM-Workbench/react-create-html-video/security/policy).\n\n### ❤️ Support\n\nLike this project? Support it with a github star, it would mean a lot to me! Cheers and Happy Coding.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm-workbench%2Freact-create-html-video","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpm-workbench%2Freact-create-html-video","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm-workbench%2Freact-create-html-video/lists"}