Sha256: cb27b9975f619cf61cd15ea3754e350e24b7cdec8e61faae156140aba4a08475

Contents?: true

Size: 1.12 KB

Versions: 2

Compression:

Stored size: 1.12 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 < ServicesMessage
      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

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

      attribute :data do
        include Mixins::VideoQuality

        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::VideoQuality
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dji_mqtt_connect-0.1.25.1 lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb
dji_mqtt_connect-0.1.25 lib/dji_mqtt_connect/messages/thing/product/services/live_start_push.rb