Module: DjiMqttConnect::Mixins::VideoQuality

Defined in:
lib/dji_mqtt_connect/mixins/video_quality.rb

Overview

Adds video quality helper methods Assumes a ‘video_quality` attribute is present of type `Types::VideoQuality`

Instance Method Summary collapse

Instance Method Details

#humanized_video_qualityObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/dji_mqtt_connect/mixins/video_quality.rb', line 8

def humanized_video_quality
  if video_quality_adaptive?
    I18n.t("adaptive", scope: "dji_mqtt_connect.video_quality")
  elsif video_quality_smooth?
    I18n.t("smooth", scope: "dji_mqtt_connect.video_quality")
  elsif video_quality_standard_definition?
    I18n.t("standard_definition", scope: "dji_mqtt_connect.video_quality")
  elsif video_quality_high_definition?
    I18n.t("high_definition", scope: "dji_mqtt_connect.video_quality")
  elsif video_quality_ultra_high_definition?
    I18n.t("ultra_high_definition", scope: "dji_mqtt_connect.video_quality")
  end
end

#video_quality_adaptive?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/dji_mqtt_connect/mixins/video_quality.rb', line 22

def video_quality_adaptive?
  video_quality == Types::VIDEO_QUALITY_ADAPTIVE
end

#video_quality_high_definition?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/dji_mqtt_connect/mixins/video_quality.rb', line 34

def video_quality_high_definition?
  video_quality == Types::VIDEO_QUALITY_HIGH_DEFINITION
end

#video_quality_smooth?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/dji_mqtt_connect/mixins/video_quality.rb', line 26

def video_quality_smooth?
  video_quality == Types::VIDEO_QUALITY_SMOOTH
end

#video_quality_standard_definition?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/dji_mqtt_connect/mixins/video_quality.rb', line 30

def video_quality_standard_definition?
  video_quality == Types::VIDEO_QUALITY_STANDARD_DEFINITION
end

#video_quality_ultra_high_definition?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/dji_mqtt_connect/mixins/video_quality.rb', line 38

def video_quality_ultra_high_definition?
  video_quality == Types::VIDEO_QUALITY_ULTRA_HIGH_DEFINITION
end