Class: Airplay::Browser
- Inherits:
-
Object
- Object
- Airplay::Browser
- Defined in:
- lib/airplay/browser.rb
Overview
Public: Browser class to find Airplay-enabled devices in the network
Constant Summary collapse
- NoDevicesFound =
Class.new(StandardError)
- SEARCH =
"_airplay._tcp."
Instance Method Summary collapse
-
#browse ⇒ Object
Public: Browses in the search of devices and adds them to the nodes.
-
#devices ⇒ Object
Public: Access to the node list.
-
#initialize ⇒ Browser
constructor
A new instance of Browser.
Constructor Details
Instance Method Details
#browse ⇒ Object
Public: Browses in the search of devices and adds them to the nodes
Returns nothing or raises NoDevicesFound if there are no devices
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/airplay/browser.rb', line 23 def browse timeout(5) do DNSSD.browse!(SEARCH) do |node| resolve(node) break unless node.flags.more_coming? end end rescue Timeout::Error => e raise NoDevicesFound end |