Sha256: 84d0e29f20791103a49ff9f73bce58af25277aafd025c11476b7d710517527d3

Contents?: true

Size: 880 Bytes

Versions: 39

Compression:

Stored size: 880 Bytes

Contents

#!/usr/bin/env ruby
# encoding: UTF-8

require 'gtk2'
require 'gst'

def usage
  $stderr.puts "Usage: #{$0} uri"
  exit 1
end

usage unless ARGV.length==1

playbin=Gst::ElementFactory.make('playbin')
playbin.ready
playbin.bus.add_watch {|bus, message|
  case message
  when Gst::MessageError
    $stderr.puts "ERROR: "+message.parse.to_s
  when Gst::MissingMessage
    puts "Installer detail: "+message.installer_detail.to_s
    if Gst::InstallPlugins.supported?
      context=Gst::InstallPluginsContext.new
      Gst::InstallPlugins.async([message.installer_detail], context){|ret| p ret}
    else
      $stderr.puts "Plugins installation is not supported."
    end
  end
  true
}
playbin.uri=ARGV[0]
playbin.play

label=Gtk::Label.new(ARGV[0])
window=Gtk::Window.new
window.add(label)
window.show_all
window.signal_connect('delete-event'){playbin.stop; Gtk.main_quit}

Gtk.main

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
gstreamer-1.2.6-x86-mingw32 sample/install-plugins.rb
gstreamer-1.2.6 sample/install-plugins.rb
gstreamer-1.2.5-x86-mingw32 sample/install-plugins.rb
gstreamer-1.2.5 sample/install-plugins.rb
gstreamer-1.2.4-x86-mingw32 sample/install-plugins.rb
gstreamer-1.2.4 sample/install-plugins.rb
gstreamer-1.2.3-x86-mingw32 sample/install-plugins.rb
gstreamer-1.2.3 sample/install-plugins.rb
gstreamer-1.2.2-x86-mingw32 sample/install-plugins.rb
gstreamer-1.2.2 sample/install-plugins.rb
gstreamer-1.2.1-x86-mingw32 sample/install-plugins.rb
gstreamer-1.2.1 sample/install-plugins.rb
gstreamer-1.2.0-x86-mingw32 sample/install-plugins.rb
gstreamer-1.2.0 sample/install-plugins.rb
gstreamer-1.1.9-x86-mingw32 sample/install-plugins.rb
gstreamer-1.1.9 sample/install-plugins.rb
gstreamer-1.1.8-x86-mingw32 sample/install-plugins.rb
gstreamer-1.1.8 sample/install-plugins.rb
gstreamer-1.1.7 sample/install-plugins.rb
gstreamer-1.1.7-x86-mingw32 sample/install-plugins.rb