Class: VieraPlay::TV

Inherits:
Object
  • Object
show all
Defined in:
lib/viera_play/tv.rb

Instance Method Summary collapse

Constructor Details

#initialize(control_url) ⇒ TV

Returns a new instance of TV.



3
4
5
6
7
8
9
# File 'lib/viera_play/tv.rb', line 3

def initialize(control_url)
  @soap_client = Soapy.new(
    :endpoint => control_url,
    :namespace => "urn:schemas-upnp-org:service:AVTransport:1",
    :default_request_args => {"InstanceID" => "0"}
  )
end

Instance Method Details

#playObject



15
16
17
# File 'lib/viera_play/tv.rb', line 15

def play
  send_command("Play", "Speed" => "1")
end

#play_uri(uri) ⇒ Object



19
20
21
22
23
# File 'lib/viera_play/tv.rb', line 19

def play_uri(uri)
  stop
  set_media_uri(uri)
  play
end

#stopObject



11
12
13
# File 'lib/viera_play/tv.rb', line 11

def stop
  send_command("Stop")
end