Class: Hikvision::Streaming::Channel
- Defined in:
- lib/hikvision/streaming/channel.rb
Instance Method Summary collapse
-
#initialize(isapi, xml) ⇒ Channel
constructor
A new instance of Channel.
- #picture(options = { cache: false }) ⇒ Object
- #url ⇒ Object
- #video_resolution ⇒ Object
- #video_resolution=(value) ⇒ Object
- #video_resolution_opts ⇒ Object
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( = { cache: false }) @isapi.get("#{url}/picture", ).response.body end |
#url ⇒ Object
100 101 102 |
# File 'lib/hikvision/streaming/channel.rb', line 100 def url "/ISAPI/Streaming/channels/#{id}" end |
#video_resolution ⇒ Object
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_opts ⇒ Object
92 93 94 |
# File 'lib/hikvision/streaming/channel.rb', line 92 def video_resolution_opts video_width_opts.zip(video_height_opts) end |