![]() Or if you want to show the camera button, microphone, and share screen (macOS only): var agSettings = AgoraSettings() If you want to show only the button to enable and disable the camera, you could set enabledButtons like this: var agSettings = AgoraSettings()ĪgSettings.enabledButtons =. enabledButtons is an OptionSet, a type that is explained by NSHipster here. The set of buttons is created using the parameter enabledButtons. red Choosing the Button Setīy default, all the buttons are added (with the flip camera button available only on iOS and share screen available only on macOS). It can be changed like this var agSettings = AgoraSettings()Ī =. There aren’t many elements where you can choose the color in this library yet - only the mute icon flag, which defaults to blue. floatPosition defaults to the top, and buttonPosition defaults to the bottom. You have the choice of top, right, bottom and left for this enumeration. The position of the collection view of all the streamers when using floating layout and the collection of buttons (such as mute microphone and beautify) can be moved around with floatPosition and buttonPosition, respectively. The entire class definition can be found here. And there’s a growing list of things to customise using AgoraSettings. Multiple layouts, including floating, grid, collection (which displays only the scrolling collection of streams), and custom (example of custom below)Ī few basic and more advanced features in this library make it customisable for your needs.Automatically subscribing to high- or low-quality video streams, depending on the size of views.Icon for signalling the local or remote streamer’s microphone is disabled.Buttons for disabling camera or microphone, beautify filter, share screen (macOS only) and switch cameras (iOS only).Allowing you to pin any stream to the larger display in the floating layout.Displaying the active speaker in the larger display in the floating layout.The layouts are also the same, with a choice of grid or floating: Agora UIKit grid layout Agora UIKit floating layout Default Functionalityīy default, Agora UIKit includes the following functionality before any customising: Optionally the application window to a specific size a UIView or NSView with the AgoraVideoViewer Method provided with the library to fill A minimal example app looks like this: import Cocoa The macOS app setup is very similar to the first example found above. The SwiftUI app makes a very similar view to that found in the previous example. See the SwiftUI example project included with the Agora UIKit repository for an example. broadcaster)įor the SwiftUI app, you may need to handle microphone and camera permission pop-ups manually. Struct ContentView: View private var connectedToChannel = falseĪgoraView.join(channel: "test", with: nil, as. If you opt to make a SwiftUI app, adding an AgoraViewer to your view looks like this: import SwiftUI For more information about token based authentication within the Agora platform please refer to this guide: iOS SwiftUI Token authentication is recommended for all RTE apps running in production environments. Note: This project is meant for reference purposes and development environments, it is not intended for production environments. } Grid layout on the left, floating layout on the right Adding Video Streaming iOS UIKitĪdding an AgoraVideoViewer to your ViewController should look like this: import UIKitĪtoresizingMask = ĪgoraView.join(channel: "test", as. To do this, open up the ist file at the root of your Xcode project and add NSCameraUsageDescription along with NSMicrophoneUsageDescription.įor more information on requesting authorization for media capture, check out this article from Apple. xcworkspace file to get started.Īdd authorisation for the app to use the camera and microphone. The latest AgoraUIKit release at the time of writing this post is v1.3. # Uncomment the next line if you want to install for macOS # Uncomment the next line if you want to install for iOS To install the CocoaPod AgoraUIKit_iOS or AgoraUIKit_macOS, your Podfile should look like this: target 'Agora-UIKit-Project' do If any errors are thrown, in Xcode select File > Swift Packages > Reset Package Caches. Xcode sometimes has issues downloading large libraries such as the Agora SDK. Go to File > Swift Packages > Add Package Dependency, and paste in this link: Swift Package Manager (Recommended, iOS Only)Īdd the URL of this repository to your Xcode 11+ Project. Start by creating an iOS or macOS project in Xcode. CocoaPods (if not using Swift Package Manager).A basic understanding of iOS development. ![]() iOS device running on iOS 13.0, or macOS minimum 10.14.An Agora developer account (see How To Get Started with Agora).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |