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

membraneframework-labs/membrane-element-httpoison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages