VideoLinkHelper

Actions Status

This is a simple library to help deal with embedded video links. It allows you to extract the ID from a video link, and can use that ID to generate an iframe to embed the video into a web application.

This library supports Youtube and Vimeo links.

Installation

This package can be installed by adding video_link_helper to your list of dependencies in mix.exs:

def deps do
  [
    {:video_link_helper, "~> 0.3.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/video_link_helper.

Usage

Extract an identifier from a Youtube or Vimeo URL:

VideoLinkHelper.extract_id("https://www.youtube.com/watch?v=dQw4w9WgXcQ")

This will return a tuple containing the video type and the ID of the video, for example:

{:youtube, "dQw4w9WgXcQ"}

A video can be embedded on a page in one of two ways:

License

This is licensed under the MIT license.