Sha256: 0612f99d152c737cd188053b144b00367e345a115c3fdd072a1fef9148355483

Contents?: true

Size: 1.09 KB

Versions: 16

Compression:

Stored size: 1.09 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
      def initialize(commands = {})
        super(commands)
      end

      def cmd
        "pushStream?params=#{Base64.urlsafe_encode64(command.join)}"
      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

16 entries across 16 versions & 1 rubygems

Version Path
evostream-event-0.2.7 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.7.pre.44 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.6 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.6.pre.41 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.6.pre.39 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.5 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.5.pre.35 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.5.pre.34 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.4 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.4.pre.31 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.3 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.3.pre.27 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.2 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.2.pre.25 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.1 lib/evostream/event/commands/push_stream.rb
evostream-event-0.2.1.pre.23 lib/evostream/event/commands/push_stream.rb