View Source Kino.Video (Kino v0.12.3)

A kino for rendering a binary video.

examples

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)

Link to this section Summary

Functions

Creates a new kino displaying the given binary video.

Link to this section Types

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

Link to this section 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

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