Sha256: 6b55eb899bce7da6cc9a61d656eba540d1219f847247c656d65fe1c189550e7d

Contents?: true

Size: 1.11 KB

Versions: 14

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

module Evostream
  module Commands
    # This will try to push a local stream to an external destination. The
    # pushed stream can only use the RTMP, RTSP or MPEG-TS unicast/multicast
    # protocol.
    class PushStream < Command
      MANDATORY = %w[uri].freeze

      def initialize(commands = {})
        super(commands)
      end

      def cmd
        super
        "pushStream?params=#{encode64}"
      end

      private

      attr_reader :command

      # TheURI of the external stream. Can be RTMP, RTSP or unicast/multicast
      # (d) mpegts
      def uri(param = 'null')
        "uri=#{param}"
      end

      # If provided, the stream will be given this name. Otherwise, a fallback
      # techniqueis used to determine the stream name (based on the URI)
      def local_stream_name(param = '')
        "localStreamName=#{param}"
      end

      # The name of the stream at destination. If not provided, the target
      # stream name willbe the same as the local stream name
      def target_stream_name(param = 'null')
        "targetStreamName=#{param}"
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
evostream-event-2.0.3 lib/evostream/event/commands/push_stream.rb
evostream-event-2.0.3.pre.1265906291 lib/evostream/event/commands/push_stream.rb
evostream-event-2.0.3.pre.1265756691 lib/evostream/event/commands/push_stream.rb
evostream-event-2.0.3.pre.1265752332 lib/evostream/event/commands/push_stream.rb
evostream-event-2.0.2 lib/evostream/event/commands/push_stream.rb
evostream-event-2.0.2.pre.994185738 lib/evostream/event/commands/push_stream.rb
evostream-event-2.0.0.pre.994170151 lib/evostream/event/commands/push_stream.rb
evostream-event-2.0.0.pre.994165179 lib/evostream/event/commands/push_stream.rb
evostream-event-2.0.0.pre.994159616 lib/evostream/event/commands/push_stream.rb
evostream-event-2.0.0.pre.856454391 lib/evostream/event/commands/push_stream.rb
evostream-event-2.0.0.pre.856447460 lib/evostream/event/commands/push_stream.rb
evostream-event-2.0.0.pre.856441003 lib/evostream/event/commands/push_stream.rb
evostream-event-2.0.0.pre.816370746 lib/evostream/event/commands/push_stream.rb
evostream-event-2.0.0.pre.809444619 lib/evostream/event/commands/push_stream.rb