Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Latest commit

 

History

History
51 lines (35 loc) · 1.59 KB

README.md

File metadata and controls

51 lines (35 loc) · 1.59 KB

Membrane Multimedia Framework: HTTPoison Element

WARNING: This element is deprecated. Please use Hackney Element instead

Build Status

This package provides elements that can be used to read files over HTTP using HTTPoison library.

It is part of Membrane Multimedia Framework.

Installation

Add the following line to your deps in mix.exs. Run mix deps.get.

{:membrane_element_httpoison, "~> 0.1"}

Sample usage

This should get you a kitten from imgur and save as kitty.jpg.

defmodule HTTPoison.Pipeline do
  use Membrane.Pipeline
  alias Pipeline.Spec
  alias Membrane.Element.File
  alias Membrane.Element.HTTPoison

  @impl true
  def handle_init(_) do
    children = [
      httpoison_src: %HTTPoison.Source{location: "http://i.imgur.com/z4d4kWk.jpg"},
      file_sink: %File.Sink{location: "kitty.jpg"},
    ]
    links = %{
      {:httpoison_src, :source} => {:file_sink, :sink}
    }

    {{:ok, %Spec{children: children, links: links}}, %{}}
  end
end

Copyright and License

Copyright 2018, Software Mansion

Software Mansion