Skip to content

Commit

Permalink
implementation deleteStream.
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo4405 committed Jul 28, 2024
1 parent 8dd8abd commit 45d109d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Examples/iOS/Preference.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
24 changes: 13 additions & 11 deletions Sources/RTMP/RTMPStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 45d109d

Please sign in to comment.