Skip to main content

Video Message

Message Box

Message Box

It is enough to define a message component with using "MessageBox".

However you have to specify type for them.

Emre

Example Usage

import { MessageBox } from "react-chat-elements"

<MessageBox
position={"left"}
type={"video"}
title={"Kursat"}
data={{
videoURL: "https://www.sample-videos.com/video123/mp4/240/big_buck_bunny_240p_1mb.mp4",
status: {
click: true,
loading: 0.5,
download: true,
},
}}
/>

Result

Kursat

Video Message Props

IVideoMessageProps (extends IVideoMessage)

propsdefaulttypedescription
onDownloadnonefunctionvideo message onDownload function (optional)
onOpennonefunctionvideo message onOpen event (onClick)
onLoadnonefunctionvideo message onLoad event (img)
onPhotoErrornonefunctionvideo message onPhotoError event (img)

IVideoMessage (extends IMessage)

propsdefaulttypedescription
controlsListnonestringvideo message controls list
datanoneobjectcontains videoURL, width, height, alt, uri, status (below)
videoURLnonestringvideoURL must be in data object (optional)
widthnonenumberwidth must be in data object (optional)
heightnonenumberheight must be in data object (optional)
altnonestringalt must be in data object (optional)
urinonestringuri must be in data object (optional)
statusnoneobjectstatus must be in data object (optional) and contains autoDownload:boolean, error:boolean, download:Function|boolean, click:Function|boolean, loading:boolean|number

IMessage Props

propsdefaulttypedescription
idnonestring | numbermessage id
positionnonestringmessage position
textnonestringmessage text
titlenonestringmessage title
focusnonebooleanmessage focus
datenonenumber | Datemessage date
dateStringnonestringmessage date string
avatarnonestringmessage avatar
titleColornonestringmessage title color
forwardednonebooleanmessage forwarded
replyButtonnonebooleanmessage reply button
removeButtonnonebooleanmessage remove button
statusnone'waiting'| 'sent' | 'received' | 'read'message status
statusTitlenonestringmessage status title
notchnonebooleanmessage notch
copiableDatenonebooleanmessage copiable date
retractednonebooleanmessage retracted
classNamenonestringmessage className
letterItemnoneobjectmessage letterItem contains id:string, letter:ReactChild
replynoneobject | anymessage reply should be both any and object (contains message:string, photoURL:string)
typenonestringmessage type