View Source Kino.Video (Kino v0.13.1)

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

@type common_video_type() :: :mp4 | :ogg | :avi | :mwv | :mov
@type mime_type() :: binary()
@type t() :: Kino.JS.Live.t()

Functions

Link to this function

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

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

Creates a new kino displaying the given binary video.

The given type 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