Skip to content

Commit

Permalink
Merge pull request #13 from huiping192/feature/object-refacoring
Browse files Browse the repository at this point in the history
remove stream id
  • Loading branch information
huiping192 committed Sep 15, 2023
2 parents 7b7f4f1 + c500749 commit 8a2510d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Example/HPLiveKit/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ViewController: UIViewController {
@objc private func buttonTapped() {
switch liveState {
case .ready, .stop, .error:
let info = LiveStreamInfo(streamId: "sample1", url: "rtmp://192.168.11.3/live/haha")
let info = LiveStreamInfo(url: "rtmp://192.168.11.3/live/haha")
liveSession?.startLive(streamInfo: info)
liveState = .start
button.setTitle("Stop", for: .normal)
Expand Down
2 changes: 0 additions & 2 deletions Sources/HPLiveKit/Objects/LiveDebug.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import Foundation

public struct LiveDebug {
/// Stream ID
var streamId: String?
/// Stream URLs
var uploadUrl: String?
/// Uploaded resolution
Expand Down
5 changes: 1 addition & 4 deletions Sources/HPLiveKit/Objects/LiveStreamInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ public enum LiveSocketErrorCode: Int {

// Stream Information
public struct LiveStreamInfo {
public let streamId: String

// --- RTMP ---

public let url: String
Expand All @@ -51,8 +49,7 @@ public struct LiveStreamInfo {
/// Video Configuration
var videoConfiguration: LiveVideoConfiguration?

public init(streamId: String, url: String) {
self.streamId = streamId
public init(url: String) {
self.url = url
}
}
1 change: 0 additions & 1 deletion Sources/HPLiveKit/Publish/RtmpPublisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ actor RtmpPublisher: Publisher {
private func _start() async {
guard !isConnected else { return }

debugInfo.streamId = stream.streamId
debugInfo.uploadUrl = stream.url

guard !isConnecting else { return }
Expand Down

0 comments on commit 8a2510d

Please sign in to comment.