{"id":13692530,"url":"https://github.com/SmashTapsOS/reactjs-videobg","last_synced_at":"2025-05-02T19:32:22.500Z","repository":{"id":44840764,"uuid":"200707670","full_name":"SmashTapsOS/reactjs-videobg","owner":"SmashTapsOS","description":"Easily add background videos to react web apps","archived":false,"fork":false,"pushed_at":"2023-01-04T06:22:07.000Z","size":8776,"stargazers_count":50,"open_issues_count":21,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T11:04:01.427Z","etag":null,"topics":["background-video","react-background-video","react-bg-video","react-video","react-video-background","react-video-bg","reactjs-background-video","reactjs-videobg"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/SmashTapsOS.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":"2019-08-05T18:23:12.000Z","updated_at":"2024-03-18T21:47:25.000Z","dependencies_parsed_at":"2023-02-02T01:16:00.964Z","dependency_job_id":null,"html_url":"https://github.com/SmashTapsOS/reactjs-videobg","commit_stats":null,"previous_names":["samabeywickrama/reactjs-videobg"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmashTapsOS%2Freactjs-videobg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmashTapsOS%2Freactjs-videobg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmashTapsOS%2Freactjs-videobg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmashTapsOS%2Freactjs-videobg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SmashTapsOS","download_url":"https://codeload.github.com/SmashTapsOS/reactjs-videobg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252095390,"owners_count":21693909,"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":["background-video","react-background-video","react-bg-video","react-video","react-video-background","react-video-bg","reactjs-background-video","reactjs-videobg"],"created_at":"2024-08-02T17:00:59.155Z","updated_at":"2025-05-02T19:32:19.929Z","avatar_url":"https://github.com/SmashTapsOS.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"[![Build Status](https://travis-ci.org/samAbeywickrama/reactjs-videobg.svg?branch=master)](https://travis-ci.org/samAbeywickrama/reactjs-videobg)\n[![Coverage Status](https://coveralls.io/repos/github/samAbeywickrama/react-video-bg/badge.svg?branch=master)](https://coveralls.io/github/samAbeywickrama/react-video-bg?branch=master)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n![npm bundle size](https://img.shields.io/bundlephobia/minzip/reactjs-videobg)\n![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\n# reactjs-videobg\n\nEasily add background videos to your webapps\n\n### [**DEMO**](https://qdync.csb.app/)\n\n## Installation\n\n### npm\n\n`npm i -S reactjs-videobg`\n\n### yarn\n\n`yarn add reactjs-videobg`\n\n## Development\n\nThis repo uses Commitizen for git commit conventions.\n\nRun `yarn commit` or `npm run commit`\n\nYou'll be prompted to fill in any required fields and your commit messages will be formatted according to the standards\n\n## Usage\n\n```jsx\nimport React from \"react\";\nimport VideoBg from \"reactjs-videobg\";\nimport ogg from \"./videos/Neon.ogg\";\nimport webm from \"./videos/Neon.webm\";\nimport mp4 from \"./videos/Neon.mp4\";\nimport poster from \"./img/poster.jpg\";\n\n\u003cVideoBg poster={poster}\u003e\n  \u003cVideoBg.Source src={ogg} type=\"video/ogg\" /\u003e\n  \u003cVideoBg.Source src={webm} type=\"video/webm\" /\u003e\n  \u003cVideoBg.Source src={mp4} type=\"video/mp4\" /\u003e\n\u003c/VideoBg\u003e;\n```\n\n[**sandbox**](https://codesandbox.io/s/sharp-poitras-qdync)\n\n## FAQ\n\n1. How to show the poster if video has finished.\n\n    This can be implemented with `onEnded` event handler. You could create an overlay and show it at the end of the video. Please have a look at this [**example**](https://github.com/samAbeywickrama/reactjs-videobg/blob/master/examples/cra/src/showPosterOnEnd)  \n\n    \n\n## API\n\n### `\u003cVideoBg /\u003e`\n\n| Prop         | Type       | Default | Required | Description                                             |\n|--------------|------------|---------|----------|---------------------------------------------------------|\n| wrapperClass | `String`   | none    | no       | className name for wrapper element.                     |\n| videoClass   | `String`   | none    | no       | className name for video element.                       |\n| loop         | `Boolean`  | `true`  | no       | Video will start over again.                            |\n| autoPlay     | `Boolean`  | `true`  | no       | Video will start playing as soon as it is ready.        |\n| poster       | `String`   | none    | no       | The image to be shown while the videos are downloading. |\n| muted        | `Boolean`  | `true`  | no       | Should audio of the video be muted?                     |\n| onEnded      | `Function` | none    | no       | Triggers on video end                                   |\n| onPlay       | `Function` | none    | no       | Triggeres on play                                       |\n| onPlaying    | `function` | none    | no       | Triggers on each time the video loops                   |\n\n### `\u003cVideoBg.Source /\u003e`\n\n| Prop | Type     | Default | Required | Description                      |\n|------|----------|---------|----------|----------------------------------|\n| src  | `String` | none    | yes      | static file or video file source |\n| type | `String` | none    | yes      | video type                       |\n\n### Resources\n\nVideos: [Pixabay - gr8effect - neon-terrain-80-retro-abstract](https://pixabay.com/videos/neon-terrain-80-retro-abstract-21368/)\nPhotos: [Pixabay - MichaelGaida - nature-landscape-moor-high-fens](https://pixabay.com/photos/nature-landscape-moor-high-fens-4356963/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSmashTapsOS%2Freactjs-videobg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSmashTapsOS%2Freactjs-videobg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSmashTapsOS%2Freactjs-videobg/lists"}