File Sharing
Actions
Action
Signature
Description
const { state, actions } = useRoomConnection(roomUrl, { localMedia });
// Share files (e.g. from an <input type="file" /> or drag-and-drop)
function onFilesSelected(files: File[]) {
actions.sendFiles(files);
}
// Download a shared file from a chat message
async function onDownload(file: ChatFileShare) {
const blob = await actions.downloadFile(file);
const url = URL.createObjectURL(blob);
// ...trigger a download or preview with `url`, then URL.revokeObjectURL(url)
}State
Field
Type
Description
FileUpload
FileUploadChatFileShare
ChatFileShareFileShareError
FileShareErrorValidation
Exported constants
Constant
Value
Description
Last updated
Was this helpful?

