Covideo platform as an embeddable React component.
npm install react-covideo-embed
This package has peer dependencies on react
and react-dom
version 16. Please ensure that you have these installed in your project.
Here’s a basic example of how to use react-covideo-embed in a React component:
import React from 'react';
import { CovideoEmbed } from 'react-covideo-embed';
const MyApp = () => {
return (
<div>
<CovideoEmbed />
</div>
);
};
export default MyApp;
Explore the capabilities of react-covideo-embed through our Demo Project. This repository serves as a practical example to understand how different props and configurations can be implemented. To run the demo locally, please follow the instructions available in the project’s README.
-
Type:
string
- Description: Used for tracking the origin of requests from this npm module.
-
Type:
string
- Description: JWT token from Covideo. If provided, the module's login/logout pages are disabled. Without it, users will need to log in through the module's login page.
-
Type:
'sandbox'
|'production'
- Description: Determines which Covideo environment to target.
-
Default:
'sandbox'
- Type: function
- Description: Callback triggered when a video is inserted.
-
Parameters:
-
shareData
: Object containing the URL and HTML of the inserted video.-
url
:string
- The URL of the inserted video. -
thumbnail
:string
- The HTML of the thumbnail of the inserted video. -
image
:string
- The URL of the thumbnail of the inserted video. -
html
:string
- The HTML representation of the inserted video. -
token
:string
- The auth token used to fetch the shareData.
-
-
-
Type:
function
- Description: Callback triggered when there is an error inserting a video.
-
Parameters:
-
error
:unknown
- The error occurred during video insert.
-
- Type: function
- Description: Callback triggered when the record button is clicked.
-
Parameters:
-
data
: Object containing the data for recording a video.-
token
:string
- The auth token.
-
-
- Type: function
- Description: Callback triggered when the upload button is clicked.
-
Parameters:
-
data
: Object containing the data for uploading a video.-
token
:string
- The auth token.
-
-
-
Type:
Array<Feature>
-
Description: Determines which Covideo features to hide. Acceptable values are as follows:
insert
recordScreen
recordBoth
recordCam
upload
trim
merge
wheelsTV
voiceover
quickshare
folder
landingPage
CTA
reactions
aiAssist
lesa
multiLocation
-
Type:
function
- Description: Log out from Covideo and clear local storage entries associated with Covideo. To reflect the logout status, the CovideoEmbed component should be re-rendered after this function is called.
This package is maintained by Covideo.