Skip to content

Video

The Video extension allows you to add a video to your editor.

Usage

tsx
import { Video } from 'reactjs-tiptap-editor'; 

const extensions = [
  ...,
  // Import Extensions Here
  Video.configure({
    upload: (files: File) => {
      return new Promise((resolve) => {
        setTimeout(() => {
          resolve(URL.createObjectURL(files))
        }, 500)
      })
    },
  }), 
];

Props

ts
interface VideoOptions extends GeneralOptions<VideoOptions> {
  /**
   * Indicates whether fullscreen play is allowed
   *
   * @default true
   */
  allowFullscreen: boolean
  /**
   * Indicates whether to display the frameborder
   *
   * @default false
   */
  frameborder: boolean
  /**
   * Width of the video, can be a number or string
   *
   * @default VIDEO_SIZE['size-medium']
   */
  width: number | string
  /** HTML attributes object for passing additional attributes */
  HTMLAttributes: {
    [key: string]: any
  }
  /** Function for uploading files */
  upload?: (file: File) => Promise<string>

  /** The source URL of the video */
  resourceVideo: 'upload' | 'link' | 'both'
}

Source

SourceDocs

Contributors

Changelog

v0.0.56 on 10/25/2024
fcd95 - feat: image inline, refactor video upload

Made with ❤️