Sha256: daba32400128f4016ecd86a202eb8fbe45008960296856ffa64bd27ef1f254d2

Contents?: true

Size: 1.7 KB

Versions: 10

Compression:

Stored size: 1.7 KB

Contents

# frozen_string_literal: true

module DjiMqttConnect
  module Thing::Product
    # Live Start Push
    # https://developer.dji.com/doc/cloud-api-tutorial/en/api-reference/dock-to-cloud/mqtt/dock/dock1/live.html
    class LiveStartPushServicesMessage < Message
      def self.build(data:, bid: generate_bid, tid: generate_tid, timestamp: current_timestamp)
        new(
          bid: bid,
          tid: tid,
          data: data,
          timestamp: timestamp,
          _method: "live_start_push"
        )
      end

      # {"0":"Agora","1":"RTMP","3":"GB28181","4":"WebRTC"}
      URL_TYPE_AGORA = 0
      URL_TYPE_RTMP = 1
      URL_TYPE_GB28181 = 3
      URL_TYPE_WEBRTC = 4

      # {"0":"Adaptive","1":"Smooth","2":"Standard definition","3":"High definition","4":"Ultra-high definition"}
      VIDEO_QUALITY_ADAPTIVE = 0
      VIDEO_QUALITY_SMOOTH = 1
      VIDEO_QUALITY_STANDARD_DEFINITION = 2
      VIDEO_QUALITY_HIGH_DEFINITION = 3
      VIDEO_QUALITY_ULTRA_HIGH_DEFINITION = 4

      attribute :tid, Types::UUID
      attribute :bid, Types::UUID
      attribute :timestamp, Types::Timestamp

      attribute :_method, Types::String.enum("live_start_push")
      attribute :data do
        attribute :url, Types::String

        attribute :url_type, Types::Integer.enum(
          URL_TYPE_AGORA,
          URL_TYPE_RTMP,
          URL_TYPE_GB28181,
          URL_TYPE_WEBRTC
        )

        attribute :video_id, Types::String

        attribute :video_quality, Types::Integer.enum(
          VIDEO_QUALITY_ADAPTIVE,
          VIDEO_QUALITY_SMOOTH,
          VIDEO_QUALITY_STANDARD_DEFINITION,
          VIDEO_QUALITY_HIGH_DEFINITION,
          VIDEO_QUALITY_ULTRA_HIGH_DEFINITION
        )
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dji_mqtt_connect-0.1.24.1 lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb
dji_mqtt_connect-0.1.24 lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb
dji_mqtt_connect-0.1.23.3 lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb
dji_mqtt_connect-0.1.23.2 lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb
dji_mqtt_connect-0.1.23.1 lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb
dji_mqtt_connect-0.1.23 lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb
dji_mqtt_connect-0.1.22.2 lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb
dji_mqtt_connect-0.1.22.1 lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb
dji_mqtt_connect-0.1.22 lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb
dji_mqtt_connect-0.1.21 lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb