Podium.Video (Podium v0.3.0)

Copy Markdown View Source

Embedded video with MIME-based extension detection.

Videos are embedded with a poster frame image and timing XML for playback control within the slide.

Summary

Functions

Maps a MIME type string to a file extension.

Returns the OPC partname for the video media file.

Creates a new video from binary data with position and size.

Generates the <p:pic> XML for the video shape on a slide.

Returns the OPC partname for the poster frame image.

Generates the timing XML for video playback in the slide's <p:timing> element.

Types

t()

@type t() :: %Podium.Video{
  binary: binary(),
  extension: String.t(),
  height: non_neg_integer(),
  media_index: pos_integer() | nil,
  mime_type: String.t(),
  poster_frame: map(),
  sha1: String.t(),
  width: non_neg_integer(),
  x: non_neg_integer(),
  y: non_neg_integer()
}

Functions

detect_extension(arg1)

@spec detect_extension(String.t()) :: String.t()

Maps a MIME type string to a file extension.

media_partname(video)

@spec media_partname(t()) :: String.t()

Returns the OPC partname for the video media file.

new(binary, opts)

@spec new(
  binary(),
  keyword()
) :: t()

Creates a new video from binary data with position and size.

Options (required)

  • :x, :y, :width, :height - position and size

Options (optional)

  • :mime_type - MIME type string (default "video/unknown")
  • :poster_frame - poster frame image binary (default: 1x1 transparent PNG)

pic_xml(video, shape_id, video_rid, media_rid, poster_rid)

@spec pic_xml(t(), pos_integer(), String.t(), String.t(), String.t()) :: String.t()

Generates the <p:pic> XML for the video shape on a slide.

poster_partname(video)

@spec poster_partname(t()) :: String.t()

Returns the OPC partname for the poster frame image.

video_timing_xml(shape_id, ctn_id)

@spec video_timing_xml(pos_integer(), pos_integer()) :: String.t()

Generates the timing XML for video playback in the slide's <p:timing> element.