{"id":30046704,"url":"https://github.com/interactive-video-labs/interactive-video-react-wrapper","last_synced_at":"2025-08-07T08:53:29.604Z","repository":{"id":307549024,"uuid":"1029816033","full_name":"interactive-video-labs/interactive-video-react-wrapper","owner":"interactive-video-labs","description":"⚛️ Thin React wrapper for the @interactive-video-labs/core library. Seamlessly embed cue-based interactive video players in your React apps using simple props and event handlers. Lightweight, declarative, and fully type-safe.","archived":false,"fork":false,"pushed_at":"2025-07-31T20:43:42.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-31T22:34:40.457Z","etag":null,"topics":["cue-points","declarative-ui","education-tech","event-driven","interactive-video","npm-package","react","react-component","react-wrapper","typescript","video-interaction","video-player"],"latest_commit_sha":null,"homepage":"","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/interactive-video-labs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2025-07-31T16:07:18.000Z","updated_at":"2025-07-31T21:02:38.000Z","dependencies_parsed_at":"2025-07-31T22:34:42.584Z","dependency_job_id":"daeb756e-5650-43e6-b03b-f8f39183d236","html_url":"https://github.com/interactive-video-labs/interactive-video-react-wrapper","commit_stats":null,"previous_names":["interactive-video-labs/interactive-video-react-wrapper"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/interactive-video-labs/interactive-video-react-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactive-video-labs%2Finteractive-video-react-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactive-video-labs%2Finteractive-video-react-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactive-video-labs%2Finteractive-video-react-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactive-video-labs%2Finteractive-video-react-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interactive-video-labs","download_url":"https://codeload.github.com/interactive-video-labs/interactive-video-react-wrapper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactive-video-labs%2Finteractive-video-react-wrapper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269227853,"owners_count":24381837,"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","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"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":["cue-points","declarative-ui","education-tech","event-driven","interactive-video","npm-package","react","react-component","react-wrapper","typescript","video-interaction","video-player"],"created_at":"2025-08-07T08:53:28.579Z","updated_at":"2025-08-07T08:53:29.579Z","avatar_url":"https://github.com/interactive-video-labs.png","language":"TypeScript","readme":"# @interactive-video-labs/react\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/interactive-video-labs/docs/main/logo.svg\" width=\"200px\" alt=\"Interactive Video Labs Logo\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/@interactive-video-labs/react\" alt=\"NPM Version\" /\u003e\n  \u003cimg src=\"https://img.shields.io/npm/l/@interactive-video-labs/react\" alt=\"NPM License\" /\u003e\n  \u003cimg src=\"https://img.shields.io/npm/d18m/@interactive-video-labs/react?style=flat-square\" alt=\"NPM Downloads\" /\u003e\n  \u003ca href=\"https://github.com/interactive-video-labs/interactive-video-react-wrapper/actions\"\u003e\n    \u003cimg src=\"https://github.com/interactive-video-labs/interactive-video-react-wrapper/actions/workflows/release.yml/badge.svg\" alt=\"Build Status\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n\nWelcome to `@interactive-video-labs/react` — a lightweight React wrapper around the `@interactive-video-labs/core` engine for cue-driven interactive video experiences.\n\nThis wrapper makes it easy to embed interactive video players in React apps using familiar props and event handlers, while keeping close to the core API.\n\n---\n\n## Introduction\n\n`@interactive-video-labs/react` is a thin React component that provides a convenient way to integrate interactive video experiences into your React applications. It leverages the powerful `@interactive-video-labs/core` engine, allowing you to easily manage video playback, cue points, and analytics within a familiar React paradigm.\n\n## Features\n\n*   **Easy Integration**: Seamlessly embed interactive videos into your React components.\n*   **Cue Point Management**: Load and manage cue points for dynamic video interactions.\n*   **Analytics Events**: Receive detailed analytics events from the video player to track user engagement.\n*   **Localization**: Support for player localization through translations.\n*   **Direct Core API Access**: Provides a React-friendly interface while maintaining close alignment with the core IVLabsPlayer API.\n\n## Installation\n\nYou can install the package using npm or pnpm:\n\n```bash\npnpm add @interactive-video-labs/react @interactive-video-labs/core react react-dom\n# or\nnpm install @interactive-video-labs/react @interactive-video-labs/core react react-dom\n```\n\n## Usage\n\nTo use the `InteractiveVideo` component, simply import it and pass the necessary props. The `videoUrl` prop is mandatory.\n\n```tsx\nimport React from 'react';\nimport { InteractiveVideo } from '@interactive-video-labs/react';\n\nconst MyVideoPlayer = () =\u003e {\n  return (\n    \u003cdiv style={{ width: '100%', maxWidth: '800px', margin: '0 auto' }}\u003e\n      \u003cInteractiveVideo\n        videoUrl=\"https://interactive-video-labs.github.io/interactive-video-demos/videos/big_buck_bunny.mp4\"\n        autoplay={true}\n        loop={false}\n        controls={true}\n        onAnalyticsEvent={(event, payload) =\u003e {\n          console.log('Analytics Event:', event, payload);\n          // Handle analytics events, e.g., send to a tracking service\n        }}\n        cues={[\n          { time: 10, id: 'intro-cue', type: 'pause' },\n          { time: 25, id: 'question-cue', type: 'custom', data: { question: 'What is your favorite color?' } },\n        ]}\n        translations={{\n          en: {\n            play: 'Play Video',\n            pause: 'Pause Video',\n          },\n        }}\n      /\u003e\n    \u003c/div\u003e\n  );\n};\n\nexport default MyVideoPlayer;\n```\n\n## Props\n\nThe `InteractiveVideo` component accepts the following props:\n\n*   `videoUrl` (string, **required**): The URL of the video to be played.\n*   `onAnalyticsEvent` (function, optional): A callback function that is triggered when an analytics event occurs. It receives the `event` name and an optional `payload`.\n    *   `event`: `PLAYER_LOADED`, `VIDEO_STARTED`, `VIDEO_PAUSED`, `VIDEO_ENDED`, `CUE_TRIGGERED`, `INTERACTION_COMPLETED`, `ERROR`.\n    *   `payload`: An object containing event-specific data.\n*   `cues` (CuePoint[], optional): An array of cue points to load into the player. Each `CuePoint` object should conform to the `@interactive-video-labs/core` `CuePoint` interface.\n*   `translations` (Translations, optional): An object containing translations for player localization. This should conform to the `@interactive-video-labs/core` `Translations` interface.\n*   `...restOptions` (PlayerConfig, optional): Any other valid `PlayerConfig` options from `@interactive-video-labs/core` (excluding `videoUrl`, `cues`, and `translations`). This allows for direct pass-through of core player configurations like `autoplay`, `loop`, `controls`, `locale`, etc.\n\n## Development\n\nTo set up the development environment:\n\n1.  Clone the repository.\n2.  Install dependencies:\n    ```bash\n    pnpm install\n    ```\n3.  Build the project:\n    ```bash\n    pnpm build\n    ```\n4.  Run tests:\n    ```bash\n    pnpm test\n    ```\n5.  Run examples:\n    ```bash\n    pnpm serve-examples\n    ```\n\n## Contributing\n\nWe welcome contributions! Please see our [CONTRIBUTING.md](CONTRIBUTING.md) for more details.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteractive-video-labs%2Finteractive-video-react-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finteractive-video-labs%2Finteractive-video-react-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteractive-video-labs%2Finteractive-video-react-wrapper/lists"}