RTMPStream
An object that provides the interface to control a one-way channel over an RTMPConnection.
-
The error domain code.
See moreDeclaration
Swift
public enum Error : Swift.Error
-
NetStatusEvent#info.code for NetStream
See moreDeclaration
Swift
public enum Code : String
-
The type of publish options.
See moreDeclaration
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(_:
Asynchronoustype: ) Sends streaming audio, vidoe and data message from client.
Declaration
Swift
public func publish(_ name: String?, type: RTMPStream.HowToPublish = .live) async throws -> RTMPResponse
-
close()
AsynchronousStops 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()
AsynchronousPauses or resumes playback of a stream.
Declaration
Swift
public func togglePause() async throws -> RTMPResponse
-
soundTransform
AsynchronousDeclaration
Swift
public var soundTransform: SoundTransform? { get async }
-
Declaration
Swift
public var audioSettings: AudioCodecSettings { get }
-
Declaration
Swift
public func setAudioSettings(_ audioSettings: AudioCodecSettings)
-
Declaration
Swift
public var videoSettings: VideoCodecSettings { get }
-
Declaration
Swift
public func setVideoSettings(_ videoSettings: VideoCodecSettings)
-
setSoundTransform(_:
Asynchronous) Declaration
Swift
public func setSoundTransform(_ soundTransform: SoundTransform) async
-
Declaration
Swift
public func setVideoInputBufferCounts(_ videoInputBufferCounts: Int)
-
Declaration
Swift
public func append(_ sampleBuffer: CMSampleBuffer)
-
Declaration
Swift
public func append(_ audioBuffer: AVAudioBuffer, when: AVAudioTime)
-
attachAudioPlayer(_:
Asynchronous) Declaration
Swift
public func attachAudioPlayer(_ audioPlayer: AudioPlayer?) async
-
Declaration
Swift
public func addOutput(_ observer: some HKStreamOutput)
-
Declaration
Swift
public func removeOutput(_ observer: some HKStreamOutput)
-
Declaration
Swift
public func setBitrateStorategy(_ bitrateStorategy: (some HKStreamBitRateStrategy)?)
-
dispatch(_:
Asynchronous) Declaration
Swift
public func dispatch(_ event: NetworkMonitorEvent) async
-
Declaration
Swift
public func selectTrack(_ id: UInt8?, mediaType: CMFormatDescription.MediaType)
-
Declaration
Swift
nonisolated public func mixer(_ mixer: MediaMixer, didOutput sampleBuffer: CMSampleBuffer)
-
Declaration
Swift
nonisolated public func mixer(_ mixer: MediaMixer, didOutput buffer: AVAudioPCMBuffer, when: AVAudioTime)