Kino.Video (Kino v0.19.0)

Copy Markdown View Source

A kino for rendering a binary video.

Examples

content = File.read!("/path/to/video.mp4")
Kino.Video.new(content, :mp4)

content = File.read!("/path/to/video.mp4")
Kino.Video.new(content, :mp4, autoplay: true, loop: true)

Summary

Functions

Creates a new kino displaying the given binary video.

Types

common_video_type()

@type common_video_type() :: :mp4 | :ogg | :avi | :mwv | :mov

mime_type()

@type mime_type() :: binary()

t()

@type t() :: Kino.JS.Live.t()

Functions

new(content, type, opts \\ [])

@spec new(binary(), common_video_type() | mime_type(), list()) :: t()

Creates a new kino displaying the given binary video.

The given type can be either :mp4, :ogg, :avi, :wmv, :mov or a string with video MIME type.

Options

  • :autoplay - whether the video should start playing as soon as it is rendered. Defaults to false

  • :loop - whether the video should loop. Defaults to false

  • :muted - whether the video should be muted. Defaults to false