diff --git a/lib/viera_play/soapy.rb b/lib/viera_play/soapy.rb index bdb3244..c026eca 100644 --- a/lib/viera_play/soapy.rb +++ b/lib/viera_play/soapy.rb @@ -23,7 +23,12 @@ def send_command(command, args={}) attr_reader :endpoint, :namespace, :default_request_args def post(headers, data) - Net::HTTP.new(endpoint.host, endpoint.port).post(endpoint.path, data, headers) + response = Net::HTTP.new(endpoint.host, endpoint.port).post(endpoint.path, data, headers) + if response.code == "200" + response + else + raise "Server error: #{response.code} #{response.body}" + end end def soap_body(command, args) diff --git a/lib/viera_play/tv.rb b/lib/viera_play/tv.rb index 21438e2..b015326 100644 --- a/lib/viera_play/tv.rb +++ b/lib/viera_play/tv.rb @@ -30,7 +30,11 @@ def play_uri(uri) attr_reader :soap_client def set_media_uri(uri) - send_command("SetAVTransportURI", "CurrentURI" => uri) + send_command( + "SetAVTransportURI", + "CurrentURI" => uri, + "CurrentURIMetaData" => "" + ) end def send_command(command, args={})