diff --git a/Examples/iOS/Preference.swift b/Examples/iOS/Preference.swift index bdf723fb9..dc513191e 100644 --- a/Examples/iOS/Preference.swift +++ b/Examples/iOS/Preference.swift @@ -2,6 +2,6 @@ struct Preference: Sendable { // Temp static nonisolated(unsafe) var `default` = Preference() - var uri: String? = "rtmp://192.168.1.4/live" + var uri: String? = "rtmp://192.168.1.6/live" var streamName: String? = "live" } diff --git a/Sources/RTMP/RTMPStream.swift b/Sources/RTMP/RTMPStream.swift index 18fe84b99..19c13735c 100644 --- a/Sources/RTMP/RTMPStream.swift +++ b/Sources/RTMP/RTMPStream.swift @@ -501,18 +501,20 @@ open class RTMPStream: IOStream { readyState = .open if let fcPublishName { connection.call("FCUnpublish", responder: nil, arguments: fcPublishName) + connection.call("deleteStream", responder: nil, arguments: id) + } else { + connection.doOutput(chunk: RTMPChunk( + type: .zero, + streamId: RTMPChunk.StreamID.command.rawValue, + message: RTMPCommandMessage( + streamId: id, + transactionId: 0, + objectEncoding: objectEncoding, + commandName: "closeStream", + commandObject: nil, + arguments: [] + ))) } - connection.doOutput(chunk: RTMPChunk( - type: .zero, - streamId: RTMPChunk.StreamID.command.rawValue, - message: RTMPCommandMessage( - streamId: 0, - transactionId: 0, - objectEncoding: self.objectEncoding, - commandName: "closeStream", - commandObject: nil, - arguments: [self.id] - ))) } func doOutput(_ type: RTMPChunkType, chunkStreamId: UInt16, message: RTMPMessage) {