RTMPStream

open class RTMPStream : IOStream
extension RTMPStream: EventDispatcherConvertible

An object that provides the interface to control a one-way channel over a RtmpConnection.

  • Declaration

    Swift

    public enum Code : String
  • The type of publish options.

    See more

    Declaration

    Swift

    public enum HowToPublish : String
  • The RTMPStream metadata.

    Declaration

    Swift

    public internal(set) var metadata: [String : Any?] { get }
  • The RTMPStreamInfo object whose properties contain data.

    Declaration

    Swift

    public internal(set) var info: RTMPStreamInfo { get }
  • The object encoding (AMF). Framework supports AMF0 only.

    Declaration

    Swift

    public private(set) var objectEncoding: RTMPObjectEncoding { get }
  • The boolean value that indicates audio samples allow access or not.

    Declaration

    Swift

    public internal(set) var audioSampleAccess: Bool { get }
  • The boolean value that indicates video samples allow access or not.

    Declaration

    Swift

    public internal(set) var videoSampleAccess: Bool { get }
  • Incoming audio plays on the stream or not.

    Declaration

    Swift

    public var receiveAudio: Bool { get set }
  • Incoming video plays on the stream or not.

    Declaration

    Swift

    public var receiveVideo: Bool { get set }
  • Pauses playback or publish of a video stream or not.

    Declaration

    Swift

    public var paused: Bool { get set }
  • Specifies the stream name used for FMLE-compatible sequences.

    Declaration

    Swift

    public var fcPublishName: String?
  • Creates a new stream.

    Declaration

    Swift

    public init(connection: RTMPConnection, fcPublishName: String? = nil)
  • Plays a live stream from RTMPServer.

    Declaration

    Swift

    public func play(_ arguments: Any?...)
  • Seeks the keyframe.

    Declaration

    Swift

    public func seek(_ offset: Double)
  • Sends streaming audio, vidoe and data message from client.

    Declaration

    Swift

    public func publish(_ name: String?, type: RTMPStream.HowToPublish = .live)
  • Stops playing or publishing and makes available other uses.

    Declaration

    Swift

    public func close()
  • Sends a message on a published stream to all subscribing clients.

    // To add a metadata to a live stream sent to an RTMP Service.
    stream.send("@setDataFrame", "onMetaData", metaData)
    // To clear a metadata that has already been set in the stream.
    stream.send("@clearDataFrame", "onMetaData");
    

    Declaration

    Swift

    public func send(handlerName: String, arguments: Any?..., isResetTimestamp: Bool = false)

    Parameters

    handlerName

    The message to send.

    arguemnts

    Optional arguments.

    isResetTimestamp

    A workaround option for sending timestamps as 0 in some services.

  • Creates flv metadata for a stream.

    Declaration

    Swift

    open func makeMetaData() -> ASObject
  • Declaration

    Swift

    override public func readyStateDidChange(to readyState: IOStream.ReadyState)

IEventDispatcher