Class: Hikvision::Streaming::Channel

Inherits:
Base
  • Object
show all
Defined in:
lib/hikvision/streaming/channel.rb

Instance Method Summary collapse

Constructor Details

#initialize(isapi, xml) ⇒ Channel

Returns a new instance of Channel.



4
5
6
7
# File 'lib/hikvision/streaming/channel.rb', line 4

def initialize(isapi, xml)
  @isapi = isapi
  @base_xml = xml
end

Instance Method Details

#picture(options = { cache: false }) ⇒ Object



96
97
98
# File 'lib/hikvision/streaming/channel.rb', line 96

def picture(options = { cache: false })
  @isapi.get("#{url}/picture", options).response.body
end

#urlObject



100
101
102
# File 'lib/hikvision/streaming/channel.rb', line 100

def url
  "/ISAPI/Streaming/channels/#{id}"
end

#video_resolutionObject



83
84
85
# File 'lib/hikvision/streaming/channel.rb', line 83

def video_resolution
  [video_width, video_height]
end

#video_resolution=(value) ⇒ Object



87
88
89
90
# File 'lib/hikvision/streaming/channel.rb', line 87

def video_resolution=(value)
  video_width = value[0]
  video_height = value[1]
end

#video_resolution_optsObject



92
93
94
# File 'lib/hikvision/streaming/channel.rb', line 92

def video_resolution_opts
  video_width_opts.zip(video_height_opts)
end