Slackblocks.Blocks.Video (slackblocks v2.8.0)

View Source

An embedded video player.

Slack reference: https://docs.slack.dev/reference/block-kit/blocks/video-block

Fields

  • alt_text — Sets a plain-text summary of the image or video for assistive technology. Required.
  • thumbnail_url — Sets the URL of the image shown before the video plays. Required.
  • title — Sets the video title. Required.
  • video_url — Sets the embeddable URL of the video. The domain must be listed in the app's unfurl domains. Required.
  • block_id — Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Optional; nil omits the field.
  • author_name — Sets the name of the video's author. Optional; nil omits the field.
  • description — Sets the video description. Optional; nil omits the field.
  • provider_icon_url — Sets the URL of the video provider's icon. Optional; nil omits the field.
  • provider_name — Sets the name of the video provider, such as YouTube. Optional; nil omits the field.
  • title_url — Sets the HTTPS URL opened when the title is clicked. Optional; nil omits the field.

Summary

Functions

Atomically replaces supplied fields; omitted fields retain their values.

Constructs and validates a value. Text conveniences apply to keyword input.

Constructs a value or raises Slackblocks.ValidationError.

Types

t()

@type t() :: %Slackblocks.Blocks.Video{
  alt_text: binary(),
  author_name: binary() | nil,
  block_id: binary() | nil,
  description: Slackblocks.Objects.PlainText.t() | nil,
  provider_icon_url: binary() | nil,
  provider_name: binary() | nil,
  thumbnail_url: binary(),
  title: Slackblocks.Objects.PlainText.t(),
  title_url: binary() | nil,
  video_url: binary()
}

Functions

change(value, options)

@spec change(
  t(),
  keyword()
) :: {:ok, t()} | {:error, Slackblocks.ValidationError.t()}

Atomically replaces supplied fields; omitted fields retain their values.

change!(value, options)

@spec change!(
  t(),
  keyword()
) :: t()

Replaces fields or raises Slackblocks.ValidationError.

new(options)

@spec new(keyword()) :: {:ok, t()} | {:error, Slackblocks.ValidationError.t()}

Constructs and validates a value. Text conveniences apply to keyword input.

new!(options)

@spec new!(keyword()) :: t()

Constructs a value or raises Slackblocks.ValidationError.