RTMPStream

public actor RTMPStream
extension RTMPStream: HKStream
extension RTMPStream: MediaMixerOutput

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

  • The error domain code.

    See more

    Declaration

    Swift

    public enum Error : Swift.Error
  • Declaration

    Swift

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

    See more

    Declaration

    Swift

    public enum HowToPublish : String, Sendable
  • The RTMPStream metadata.

    Declaration

    Swift

    public private(set) var metadata: AMFArray { get }
  • The RTMPStreamInfo object whose properties contain data.

    Declaration

    Swift

    public private(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 private(set) var audioSampleAccess: Bool { get }
  • The boolean value that indicates video samples allow access or not.

    Declaration

    Swift

    public private(set) var videoSampleAccess: Bool { get }
  • The number of video frames per seconds.

    Declaration

    Swift

    @Published
    public private(set) var currentFPS: UInt16 { get set }
  • The ready state of stream.

    Declaration

    Swift

    @Published
    public private(set) var readyState: HKStreamReadyState { get set }
  • The stream of events you receive RTMP status events from a service.

    Declaration

    Swift

    public var status: AsyncStream<RTMPStatus> { get }
  • The stream’s name used for FMLE-compatible sequences.

    Declaration

    Swift

    public private(set) var fcPublishName: String? { get }
  • Declaration

    Swift

    public private(set) var videoTrackId: UInt8? { get }
  • Declaration

    Swift

    public private(set) var audioTrackId: UInt8? { get }
  • Creates a new stream.

    Declaration

    Swift

    public init(connection: RTMPConnection, fcPublishName: String? = nil)
  • play(_:) Asynchronous

    Plays a live stream from a server.

    Declaration

    Swift

    public func play(_ arguments: (any Sendable)?...) async throws -> RTMPResponse
  • seek(_:) Asynchronous

    Seeks the keyframe.

    Declaration

    Swift

    public func seek(_ offset: Double) async throws
  • publish(_:type:) Asynchronous

    Sends streaming audio, vidoe and data message from client.

    Declaration

    Swift

    public func publish(_ name: String?, type: RTMPStream.HowToPublish = .live) async throws -> RTMPResponse
  • close() Asynchronous

    Stops playing or publishing and makes available other uses.

    Declaration

    Swift

    public func close() async throws -> RTMPResponse
  • 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 Sendable)?..., isResetTimestamp: Bool = false) throws

    Parameters

    handlerName

    The message to send.

    arguemnts

    Optional arguments.

    isResetTimestamp

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

  • receiveAudio(_:) Asynchronous

    Incoming audio plays on a stream or not.

    Declaration

    Swift

    public func receiveAudio(_ receiveAudio: Bool) async throws
  • receiveVideo(_:) Asynchronous

    Incoming video plays on a stream or not.

    Declaration

    Swift

    public func receiveVideo(_ receiveVideo: Bool) async throws
  • pause(_:) Asynchronous

    Pauses playback a stream or not.

    Declaration

    Swift

    public func pause(_ paused: Bool) async throws -> RTMPResponse
  • togglePause() Asynchronous

    Pauses or resumes playback of a stream.

    Declaration

    Swift

    public func togglePause() async throws -> RTMPResponse

HKStream

MediaMixerOutput