Skip to content

Commit

Permalink
Merge pull request #1 from cwninja/fix-for-xbmc
Browse files Browse the repository at this point in the history
Fix for xbmc
  • Loading branch information
pipt committed Apr 8, 2013
2 parents 72011bc + f7ea18d commit 9587f48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/viera_play/soapy.rb
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion lib/viera_play/tv.rb
Expand Up @@ -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={})
Expand Down

0 comments on commit 9587f48

Please sign in to comment.