Swiftpack.co - AgoraIO-Community/SwiftUIRtc as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by AgoraIO-Community.
AgoraIO-Community/SwiftUIRtc 0.2.0
Classes to make using SwiftUI and Agora Video SDK easier
⭐️ 1
🕓 1 week ago
iOS macOS
.package(url: "https://github.com/AgoraIO-Community/SwiftUIRtc.git", from: "0.2.0")

SwiftUIRtc

SwiftUIRtc is a package for building video call apps using the Agora RTC SDK and SwiftUI. It provides a set of SwiftUI views and classes that simplify setting up and managing Agora RTC sessions for video calls.

This is not an official product of Agora, it is simply an open source project for helping developers use the RTC engine is new ways, such as with SwiftUI. If you have any issues with the classes in this repository, please open an issue or a PR. Agora's support team will likely not know about this package.

Installation

SwiftUIRtc can be installed using Swift Package Manager in Xcode. Simply add the package to your project by navigating to File > Swift Packages > Add Package Dependency and entering the repository URL:

https://github.com/AgoraIO-Community/SwiftUIRtc.git

Usage

To use SwiftUIRtc in your SwiftUI project, simply import the package and use the provided views and classes. For example, you can use AgoraVideoCanvasView and AgoraManager view to render all the video streams in an Agora RTC session:

import SwiftUIRtc
import AgoraRtcKit

struct AgoraGettingStartedView: View {
    @ObservedObject var agoraManager = AgoraManager(appId: <#AppId#>, role: .broadcaster)
    var channelId: String = "test"
    var body: some View {
        ScrollView {
            VStack {
                ForEach(Array(agoraManager.allUsers), id: \.self) { uid in
                    AgoraVideoCanvasView(manager: agoraManager, uid: uid)
                        .aspectRatio(contentMode: .fit).cornerRadius(10)
                }
            }.padding(20)
        }.onAppear {
            agoraManager.engine.joinChannel(
                byToken: <#Agora Temp Token#>, channelId: channelId, info: nil, uid: 0
            )
        }.onDisappear {
            agoraManager.engine.leaveChannel()
        }
    }
}

Contributing

Contributions to SwiftUIRtc are welcome! If you encounter any issues or have feature requests, please submit an issue on the GitHub repository. Pull requests are also welcome.

License

SwiftUIRtc is available under the MIT license. See the LICENSE file for more information.

GitHub

link
Stars: 1
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Default Implementation Keeps User ID's
8 weeks ago
  • Added some more default behaviour, to record user Ids when people connect or disconnect
  • Added initial documentation coverage and deployment

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics