Skip to content
HTTP source based on hackney
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
lib
test
.formatter.exs
.gitignore
.travis.yml
LICENSE
README.md
mix.exs
mix.lock

README.md

Membrane Multimedia Framework: Hackney Element

Build Status

This package provides elements that can be used to read files over HTTP using Hackney 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_hackney, "~> 0.1"}

Sample usage

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

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

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

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

Copyright and License

Copyright 2018, Software Mansion

Software Mansion

You can’t perform that action at this time.