Notion Helper - v1.3.29
    Preparing search index...

    Function createBlock

    • Creates a video block.

      Parameters

      • options: string | Object

        A string representing the video URL, a file upload ID, or an options object.

        • string
        • Object
          • url

            The URL for the video.

          • id

            The ID of the file upload.

          • caption

            The caption as a string, an array of strings, or an array of rich text objects.

      Returns Object | null

      A video block object compatible with Notion's API, or null if the URL/ID is invalid.

      // Use with a video URL
      const externalVideo = block.video.createBlock("https://www.youtube.com/watch?v=ec5m6t77eYM");

      // Use with a file upload ID
      const fileUploadVideo = block.video.createBlock("123e4567-e89b-12d3-a456-426614174000");

      // Use with options object for external video
      const externalVideo = block.video.createBlock({
      url: "https://www.youtube.com/watch?v=ec5m6t77eYM",
      caption: "Never gonna give you up"
      });

      // Use with options object for file upload
      const fileUploadVideo = block.video.createBlock({
      id: "123e4567-e89b-12d3-a456-426614174000",
      caption: "Never gonna give you up"
      });