Skip to content

Commit

Permalink
Merge pull request #3 from AgoraIO-Community/bump-4.0.1
Browse files Browse the repository at this point in the history
Bumped up to iOS 4.0.1 build.
  • Loading branch information
maxxfrazer authored Oct 11, 2022
2 parents 5d0e3e1 + f237a1c commit 9076bb1
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 76 deletions.
33 changes: 25 additions & 8 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,43 @@
name: Deploy DocC

on:
# Runs on pushes targeting the default branch
push:
branches:
- "main"
branches: ["main"]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build_docs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: macos-12
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Build DocC 🛠
run: |
sudo xcode-select -s /Applications/Xcode_14.0.app;
xcodebuild docbuild -scheme AgoraUIKit -derivedDataPath /tmp/docbuild -destination 'platform=macOS';
$(xcrun --find docc) process-archive \
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug/AgoraUIKit.doccarchive \
--output-path docs \
--hosting-base-path VideoUIKit-macOS;
- name: Deploy to GitHub Pages 🐙
uses: JamesIves/github-pages-deploy-action@v4
echo "<script>window.location.href += \"/documentation/agorauikit\"</script>" > docs/index.html
- name: Upload artifact 📜
uses: actions/upload-pages-artifact@v1
with:
folder: docs
# Upload docs directory
path: 'docs'
- name: Deploy to GitHub Pages 🐙
id: deployment
uses: actions/deploy-pages@v1
4 changes: 4 additions & 0 deletions .github/workflows/swift-build-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ jobs:
DESTINATION: 'platform=macOS'
- name: Pod Lint 🔎
run: pod lib lint AgoraUIKit_macOS.podspec --allow-warnings --skip-import-validation --include-podspecs='AgoraRtmControl_macOS.podspec'
- name: Print Version 🔤
run: |
echo '### Build passed :rocket:' >> $GITHUB_STEP_SUMMARY
echo "Version: $(grep 'static let version' Sources/Agora-Video-UIKit/AgoraUIKit.swift | sed -e 's,.*\"\(.*\)\",\1,')" >> $GITHUB_STEP_SUMMARY
2 changes: 1 addition & 1 deletion AgoraRtmControl_macOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Pod::Spec.new do |s|
s.name = 'AgoraRtmControl_macOS'
s.module_name = 'AgoraRtmControl'
s.version = ENV['LIB_VERSION'] || '4.0.0'
s.version = ENV['LIB_VERSION'] || '4.0.1'
s.summary = 'Agora Real-time Messaging Wrapper.'

s.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions AgoraUIKit_macOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Pod::Spec.new do |s|
s.name = 'AgoraUIKit_macOS'
s.module_name = 'AgoraUIKit'
s.version = ENV['LIB_VERSION'] || '4.0.0'
s.version = ENV['LIB_VERSION'] || '4.0.1'
s.summary = 'Agora video session AppKit template.'

s.description = <<-DESC
Expand All @@ -27,6 +27,6 @@ Use this Pod to create a video AppKit view that can be easily added to your macO
s.static_framework = true
s.source_files = 'Sources/Agora-Video-UIKit/*'
s.pod_target_xcconfig = { 'ONLY_ACTIVE_ARCH' => 'YES' }
s.dependency 'AgoraRtcEngine_macOS/RtcBasic', '~> 4.0.0.4'
s.dependency 'AgoraRtcEngine_macOS/RtcBasic', '~> 4.0.1'
s.dependency 'AgoraRtmControl_macOS', "#{s.version.to_s}"
end
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
.package(
name: "AgoraRtcKit",
url: "https://github.com/AgoraIO/AgoraRtcEngine_macOS",
revision: "4.0.0-r.4"
.upToNextMinor(from: Version(4, 0, 1))
),
.package(
name: "AgoraRtmKit",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Agora UIKit for macOS
# Agora Video UI Kit for macOS

<p align="center">
<img src="https://github.com/AgoraIO-Community/VideoUIKit-macOS/actions/workflows/swift-build-lint.yml/badge.svg"/>
Expand Down Expand Up @@ -36,7 +36,7 @@ Once you have an Agora developer account and an App ID, you're ready to use this

Swift Package Manager and CocoaPods are both available offered for installation methods.

The Pod for this package is called `AgoraUIKit_iOS` and `AgoraUIKit_macOS` for the two available platforms.
The Pod for this package is called `AgoraUIKit_macOS`.

See the [Installation wiki](https://github.com/AgoraIO-Community/VideoUIKit-iOS/wiki/Installation) page for more information on installing the package.

Expand Down
8 changes: 5 additions & 3 deletions Sources/Agora-Video-UIKit/AgoraCollectionViewer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import UIKit
import AppKit
#endif

/// Collection View to display all connected users camera feeds
public class AgoraCollectionViewer: MPCollectionView {
/// Collection View to display all connected users camera feeds. Used in the streamerCollectionView.
internal class AgoraCollectionViewer: MPCollectionView {

static let cellSpacing: CGFloat = 5
public static var flowLayout: MPCollectionViewFlowLayout {

/// Details for the collection list of participants camera feeds.
static var flowLayout: MPCollectionViewFlowLayout {
let flowLayout = MPCollectionViewFlowLayout()
flowLayout.itemSize = CGSize(width: 100, height: 100)
flowLayout.scrollDirection = .horizontal
Expand Down
11 changes: 11 additions & 0 deletions Sources/Agora-Video-UIKit/AgoraSingleVideoView+RtmDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,21 @@ public protocol SingleVideoViewDelegate: AnyObject {
#if canImport(AgoraRtmControl)
/// RTM Controller class for managing RTM messages
var rtmController: AgoraRtmController? { get set }
/// Create and send request to user to mute/unmute a device
/// - Parameters:
/// - uid: RTM User ID to send the request to
/// - str: String from the action label to
/// - Returns: Boolean stating if the request was valid or not
func createRequest(
to uid: UInt,
fromString str: String
) -> Bool
/// Create and send request to mute/unmute a device
/// - Parameters:
/// - rtcId: RTC User ID to send the request to
/// - mute: Whether the device should be muted or unmuted
/// - device: Type of device (camera/microphone)
/// - isForceful: Whether the request should force its way through, otherwise a request is made. Cannot forcefully unmute.
func sendMuteRequest(to rtcId: UInt, mute: Bool, device: AgoraVideoViewer.MutingDevices, isForceful: Bool)

#endif
Expand Down
36 changes: 26 additions & 10 deletions Sources/Agora-Video-UIKit/AgoraUIKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,64 @@
import Foundation
import AgoraRtcKit

/// Agora UIKit data structure. Access `AgoraUIKit.current` for information
/// about your UIKit version.
/// Agora UIKit data structure. Access ``AgoraUIKit/AgoraUIKit/current`` for information
/// about your Video UI Kit version.
public struct AgoraUIKit: Codable {
/// Instance of the current AgoraUIKit instance.
public static var current: AgoraUIKit {
AgoraUIKit(version: AgoraUIKit.version, platform: AgoraUIKit.platform, framework: AgoraUIKit.framework)
}
/// Platform that is being used: ios, macos, android, unknown
fileprivate(set) var platform: String
public fileprivate(set) var platform: String
/// Version of UIKit being used
fileprivate(set) var version: String
public fileprivate(set) var version: String
/// Framework type of UIKit. "native", "flutter", "reactnative"
fileprivate(set) var framework: String
public fileprivate(set) var framework: String
/// Version of UIKit being used
static let version = "4.0.0"
public static let version = "4.0.1"
/// Framework type of UIKit. "native", "flutter", "reactnative"
static let framework = "native"
public static let framework = "native"
#if os(iOS)
/// Platform that is being used: ios, macos, android, unknown
static let platform = "ios"
public static let platform = "ios"
#elseif os(macOS)
/// Platform that is being used: ios, macos, android, unknown
static let platform = "macos"
public static let platform = "macos"
#else
/// Platform that is being used: ios, macos, android, unknown
static let platform = "unknown"
public static let platform = "unknown"
#endif
fileprivate init(version: String, platform: String, framework: String) {
self.version = version
self.platform = platform
self.framework = framework
}
/// Get the Video UI Kit details in a pretty printed string format. Used for print statements.
/// - Returns: String of the version, platform and framework.
func prettyPrint() -> String {
"""
version: \(version)
platform: \(platform)
framework: \(framework)
"""
}
/// Initialiser from a decoder. Used for internal purposes only
/// - Parameter decoder: Decoder object that is used to set all the properties.
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.platform = try container.decode(String.self, forKey: .platform)
self.version = try container.decode(String.self, forKey: .version)
self.framework = try container.decode(String.self, forKey: .framework)
}
/// Converts an unsigned UInt32 to a regular signed Int. This is to handle User Id's across multiple platforms.
/// - Parameter uint: Unigned integer userId
/// - Returns: Signed integer userId
public static func uintToInt(_ uint: UInt) -> Int {
Int(Int32(bitPattern: UInt32(uint)))
}
/// Converts a regular Int to an unsigned UInt32. This is to handle User Id's across multiple platforms.
/// - Parameter userInt: Signed integer userId
/// - Returns: Unsigned integer userId
public static func intToUInt(_ userInt: Int) -> UInt {
UInt(UInt32(bitPattern: Int32(userInt)))
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// AgoraVideoViewer.swift
// AgoraVideoViewer+AgoraExtensions.swift
// Agora-Video-UIKit
//
// Created by Max Cobb on 09/09/2021.
Expand Down
7 changes: 7 additions & 0 deletions Sources/Agora-Video-UIKit/AgoraVideoViewer+Token.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ extension AgoraVideoViewer {
case invalidURL
}

/// Update the token currently in use by the Agora SDK. Used to not interrupt an active video session.
/// - Parameter newToken: new token to be applied to the current connection.
@objc open func updateToken(_ newToken: String) {
self.currentRtcToken = newToken
self.agkit.renewToken(newToken)
}

/// Requests the token from our backend token service
/// - Parameter urlBase: base URL specifying where the token server is located
/// - Parameter channelName: Name of the channel we're requesting for
Expand Down
Loading

0 comments on commit 9076bb1

Please sign in to comment.