Skip to content

Commit

Permalink
Use default bundle policy (#25)
Browse files Browse the repository at this point in the history
* Change bundle policy, specify minimum Infinity version

* Remove . and newline

* Fix RTCConfigurationDefaultTests

* Fix version comparison

* Move the warning to InfinityClientFactory
  • Loading branch information
vadymmarkov authored Jun 1, 2023
1 parent 55d45d2 commit 476c26a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Integrate Pexip Swift SDK into your project using Swift Package Manager, CocoaPo
- macOS 10.15+
- Swift 5.5 with structured concurrency support
- Xcode 13
- Pexip Infinity v29 and higher

## Swift Package Manager

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ media signaling technologies in the future, or Infinity might be interchanged wi
- macOS 10.15+
- Swift 5.5 with structured concurrency support
- Xcode 13
- Pexip Infinity v29 and higher

:warning: **The project doesn't compile on Xcode 14.3 because of incorrect availability attributes CGDisplayStream.h file (introduced: is 13.0 instead of 10.8). Let's hope it's fixed in future Xcode versions.**

Expand Down
17 changes: 17 additions & 0 deletions Sources/PexipInfinityClient/InfinityClientFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public struct InfinityClientFactory {
)
}

// swiftlint:disable function_body_length
/**
Creates a new instance of ``Conference`` type.

Expand All @@ -124,6 +125,21 @@ public struct InfinityClientFactory {
alias: ConferenceAlias,
token: ConferenceToken
) -> Conference {
if token.version.versionId < "29" {
logger?.warn(
"""
WARNING: Infinity v\(token.version.versionId) support.
We offer only limited support for Infinity versions prior to v29.
You may experience problems with sending and receiving presentation.
Use `presentationInMain` to mix presentation with main video feed.
This will be a fatar error in Q4 2023.
"""
)
}

let conferenceService = infinityService().node(url: node).conference(alias: alias)
let tokenStore = TokenStore(token: token)
let roster = roster(token: token, service: conferenceService)
Expand Down Expand Up @@ -164,6 +180,7 @@ public struct InfinityClientFactory {
logger: logger
)
}
// swiftlint:enable function_body_length

// MARK: - Internal methods

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2022 Pexip AS
// Copyright 2022-2023 Pexip AS
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,7 +29,7 @@ extension RTCConfiguration {
credential: $0.password
)
}
configuration.bundlePolicy = .maxBundle
configuration.bundlePolicy = .balanced
configuration.sdpSemantics = .unifiedPlan
configuration.enableDscp = dscp
configuration.continualGatheringPolicy = .gatherContinually
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2022 Pexip AS
// Copyright 2022-2023 Pexip AS
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,7 +36,7 @@ final class RTCConfigurationDefaultTests: XCTestCase {
XCTAssertEqual(configuration.iceServers.count, 1)
XCTAssertEqual(configuration.iceServers.first?.urlStrings, iceServer.urls)
XCTAssertEqual(configuration.sdpSemantics, .unifiedPlan)
XCTAssertEqual(configuration.bundlePolicy, .maxBundle)
XCTAssertEqual(configuration.bundlePolicy, .balanced)
XCTAssertEqual(configuration.continualGatheringPolicy, .gatherContinually)
XCTAssertEqual(configuration.rtcpMuxPolicy, .require)
XCTAssertEqual(configuration.tcpCandidatePolicy, .enabled)
Expand Down

0 comments on commit 476c26a

Please sign in to comment.