Use this guide to add collaboration into your own custom video player.
Set up Velt Components in your app
Velt Comments
: Renders comments on the DOM.Velt Comment Tool
: Enables or disables adding comments.Velt Reaction Tool
: Enables or disables adding reactions.Velt Comment Player Timeline
: Adds comments bubble over your player seek bar.Velt Comments Sidebar
: Adds a sidebar that shows all comments. Users can also search, filter & navigate to the comments from here.Velt Sidebar Button
: Toggles the sidebar on/off.Velt Comments
component in the root of your appVelt Comments
component to the root of your app.Velt Comment Tool
component wherever you want your render the comment tool.Velt Reaction Tool
component wherever you want your render the reaction tool.onReactionToolClick
events.Velt Comment Player Timeline
component as a sibling to your video player.Velt Comment Player Timeline
component as a sibling to your video player component.velt comment player timeline
component and one sibling video player component per documentID
velt comment player timeline
doesnt have CSS position value as ‘static’.id
to the video player or its parent element.<video>
player, you can add an id
to the parent element of the video player.Velt Comments Sidebar
component.embedMode
prop as true
.Velt Sidebar Button
component.Set the `total media length` on the `Velt Comment Player Timeline`
total media length
using props to represent the total number of frames or seconds in the video:Detect Comment Tool Activation and Set Media Location
onCommentModeChange
event.Location
in the Velt SDK.Velt Comment Player Timeline
component, ensure to set the current rounded frame or second in the special key currentMediaPosition
.
currentMediaPosition
is a protected keyword that is used to arrange the comment bubbles on top of the video player timeline in the correct spotDetect Reaction Tool Activation and Set Media Location
onReactionToolClick
event.Location
in the Velt SDK.Velt Comment Player Timeline
component, ensure to set the current rounded frame or second in the special key currentMediaPosition
.
currentMediaPosition
is a protected keyword that is used to arrange the comment bubbles on top of the video player timeline in the correct spotWhen the player is played, remove Velt `Location` to remove comments from the media.
removeLocation()
when your player starts playing:Navigate to the comment's location in the player from the Sidebar or Timeline.
onCommentClick
event handler on the Velt Comments Sidebar
& Velt Comment Player Timeline
components you added earlier.
The event will give you back the location
object that you had set on the comment.Use this object to:location
so the comments associated with that location
are rendered.Velt Comments Sidebar
:Velt Comment Player Timeline
:property | type | description |
---|---|---|
documentId | string | The document ID where the comment was added |
location | object | The location where the comment was added |
targetElementId | string | The DOM ID of the target element on which the comment was added |
context | Object | Any context data passed when the comment was added |