@revideo/player-react
Last updated
Last updated
You can embed your videos into your website using the Revideo react player.
Install the @revideo/player-react
package into your project:
You have two options to use the player:
Inside your Revideo project directory, run:
This will start a local server that builds (and rebuilds) your project and serves all required assets. You can then embed the player into your website like this:
If you don't want to use the CLI to serve your built project, you can build it manually by running:
This will create an out
directory in your project root. You can then copy all of these files to any public directory on your server and embed the player by specifying the path to the directory. Say you copied the files to /public/outDir
, and the folder is accessible via https://example.com/outDir
, you can embed the player like this:
The path to your bundle folder.
boolean
Disables the player controls when set to false. default=true
Record<string, any>
boolean
Specifies if the player is currently playing. default=false
number
Current time of the player in seconds.
boolean
Controls whether the to loop back to the beginning when the player reaches the end of the video. default=true
number
Width of the underlying canvas element in pixels. It's recommended to leave this setting empty as it crops the scene instead of stretching it. default=undefined
number
See width
. default=undefined
number
Reduces or increases the resolution of the canvas element without affecting the positioning of elements. default=1
(duration: number) => void
Gets called every time the duration of the video changes (this can happen due to the input variables changing).
(time: number) => void
Gets called every time the current time of the video is changed (every few ms during playback). Useful when visualizing the progress of the player outside of the player component.
'MM:SS' | 'MM:SS.m' | 'MM:SS.mm'
Determines how time is displayed on the player.
Parameters / or variables passed to your video. See learn more about parameterized videos. default={}