Skip to content

Instantly share code, notes, and snippets.

@thomas-mcdonald
Created June 18, 2012 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomas-mcdonald/2950487 to your computer and use it in GitHub Desktop.
Save thomas-mcdonald/2950487 to your computer and use it in GitHub Desktop.
Madeon over HTTP
require 'gst'
require 'sinatra'
class App < Sinatra::Application
configure do
Gst.init
@@pipeline = Gst::ElementFactory.make("playbin2")
@@pipeline.uri = GLib.filename_to_uri(File.expand_path(File.dirname(__FILE__)) + '/icarus.mp3')
end
get '/play' do
@@pipeline.play
end
get '/stop' do
@@pipeline.stop
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment