Class: AirPlayer::App
- Inherits:
-
Thor
- Object
- Thor
- AirPlayer::App
- Defined in:
- lib/airplayer/app.rb
Instance Method Summary collapse
Instance Method Details
#devices ⇒ Object
23 24 25 26 27 |
# File 'lib/airplayer/app.rb', line 23 def devices Device.devices.each_with_index do |device, number| puts "#{number}: #{device.name} (Resolution: #{device.info.resolution}, Version: #{device.info.os_version}, IP: #{device.address})" end end |
#play(target) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/airplayer/app.rb', line 11 def play(target) YoutubeDl.path = [:youtube_dl] controller = Controller.new(device: .fetch('device', 0)) Playlist.new().add(target).entries do |media| controller.play(media) controller.pause end rescue Interrupt # capture Ctrl-C end |
#version ⇒ Object
31 32 33 |
# File 'lib/airplayer/app.rb', line 31 def version puts VERSION end |