Sanity Library Reference Docs
    Preparing search index...

    Function defineVideoField

    • Beta

      Define a video field within a document, object, image or file definition fields array.

      This function will narrow the schema type down to video fields and options based on the provided type-string.

      Using defineVideoField is optional, but should provide improved autocompletion in your IDE, when building your schema. Video field-properties like validation and initialValue will also be more specific.

      Note: This video field type is designed to work specifically with the Media Library asset source. Make sure you have the Media Library is enabled in your studio via sanity.config.ts.

      See defineType for similar examples.

      Parameters

      • definition: Omit<VideoDefinition, "type">

        should be a valid video field type definition.

      Returns { name: string; type: "sanity.video" } & Omit<VideoDefinition, "preview"> & {
          preview?: PreviewConfig<Record<string, string>, Record<string, any>>;
      } & FieldDefinitionBase & WidenValidation & WidenInitialValue

      • defineField
      • defineArrayMember
      • typed