Sha256: 3241b354337654138d1ed3c091c6610480e78df77900787ba221c07fca6b3cd5

Contents?: true

Size: 1.26 KB

Versions: 2

Compression:

Stored size: 1.26 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
        base = command.join
        Evostream.logger "Parameters : #{base}"
        string = Base64.strict_encode64(base)
        Evostream.logger "Base 64 decoded : #{Base64.strict_decode64(string)}"
        "pushStream?params=#{string}"
      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

2 entries across 2 versions & 1 rubygems

Version Path
evostream-event-0.3.0 lib/evostream/event/commands/push_stream.rb
evostream-event-0.3.0.pre.48 lib/evostream/event/commands/push_stream.rb