Sha256: b97ac60423ae2cbe4c19152d0e77005f6eafd5d5e199542f14f054189ba3c597

Contents?: true

Size: 1.11 KB

Versions: 13

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=#{encode_64}"
      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

13 entries across 13 versions & 1 rubygems

Version Path
evostream-event-1.0.3 lib/evostream/event/commands/push_stream.rb
evostream-event-1.0.3.pre.95 lib/evostream/event/commands/push_stream.rb
evostream-event-1.0.3.pre.93 lib/evostream/event/commands/push_stream.rb
evostream-event-1.0.3.pre.91 lib/evostream/event/commands/push_stream.rb
evostream-event-1.0.3.pre.83 lib/evostream/event/commands/push_stream.rb
evostream-event-1.0.2 lib/evostream/event/commands/push_stream.rb
evostream-event-1.0.2.pre.75 lib/evostream/event/commands/push_stream.rb
evostream-event-1.0.2.pre.74 lib/evostream/event/commands/push_stream.rb
evostream-event-1.0.1 lib/evostream/event/commands/push_stream.rb
evostream-event-1.0.1.pre.72 lib/evostream/event/commands/push_stream.rb
evostream-event-1.0.0 lib/evostream/event/commands/push_stream.rb
evostream-event-1.0.0.pre.69 lib/evostream/event/commands/push_stream.rb
evostream-event-1.0.0.pre.65 lib/evostream/event/commands/push_stream.rb