Skip to content

Commit 2f9ad28

Browse files
authored
tvOS support (#466)
tvOS 17+, arm device + arm simulator only
1 parent 02aadd4 commit 2f9ad28

File tree

9 files changed

+18
-14
lines changed

9 files changed

+18
-14
lines changed

.github/workflows/testing-matrix.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
- os: macos-14
4444
xcode: 15.4
4545
platform: "visionOS Simulator" # visionOS 1.2
46+
- os: macos-14
47+
xcode: 15.4
48+
platform: "tvOS"
4649
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
4750
- os: macos-14
4851
xcode: 16.0-beta

LiveKitClient.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Pod::Spec.new do |spec|
1414

1515
spec.source_files = "Sources/**/*"
1616

17-
spec.dependency("LiveKitWebRTC", "= 125.6422.06")
17+
spec.dependency("LiveKitWebRTC", "= 125.6422.07")
1818
spec.dependency("SwiftProtobuf")
1919
spec.dependency("Logging")
2020

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let package = Package(
1818
],
1919
dependencies: [
2020
// LK-Prefixed Dynamic WebRTC XCFramework
21-
.package(url: "https://github.com/livekit/webrtc-xcframework.git", exact: "125.6422.06"),
21+
.package(url: "https://github.com/livekit/webrtc-xcframework.git", exact: "125.6422.07"),
2222
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.26.0"),
2323
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.4"),
2424
// Only used for DocC generation

[email protected]

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ let package = Package(
1010
.macOS(.v10_15),
1111
.macCatalyst(.v14),
1212
.visionOS(.v1),
13+
.tvOS(.v17),
1314
],
1415
products: [
1516
.library(
@@ -19,7 +20,7 @@ let package = Package(
1920
],
2021
dependencies: [
2122
// LK-Prefixed Dynamic WebRTC XCFramework
22-
.package(url: "https://github.com/livekit/webrtc-xcframework.git", exact: "125.6422.06"),
23+
.package(url: "https://github.com/livekit/webrtc-xcframework.git", exact: "125.6422.07"),
2324
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.26.0"),
2425
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.4"),
2526
// Only used for DocC generation

Sources/LiveKit/Support/NativeView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import UIKit
2222
import AppKit
2323
#endif
2424

25-
#if os(iOS) || os(visionOS)
25+
#if os(iOS) || os(visionOS) || os(tvOS)
2626
public typealias NativeViewType = UIView
2727
#elseif os(macOS)
2828
public typealias NativeViewType = NSView
@@ -41,7 +41,7 @@ open class NativeView: NativeViewType {
4141
fatalError("init(coder:) has not been implemented")
4242
}
4343

44-
#if os(iOS) || os(visionOS)
44+
#if os(iOS) || os(visionOS) || os(tvOS)
4545
override public func layoutSubviews() {
4646
super.layoutSubviews()
4747
performLayout()

Sources/LiveKit/Support/NativeViewRepresentable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import UIKit
2323
import AppKit
2424
#endif
2525

26-
#if os(iOS) || os(visionOS)
26+
#if os(iOS) || os(visionOS) || os(tvOS)
2727
public typealias NativeViewRepresentableType = UIViewRepresentable
2828
#elseif os(macOS)
2929
public typealias NativeViewRepresentableType = NSViewRepresentable
@@ -40,7 +40,7 @@ public protocol NativeViewRepresentable: NativeViewRepresentableType {
4040
}
4141

4242
public extension NativeViewRepresentable {
43-
#if os(iOS) || os(visionOS)
43+
#if os(iOS) || os(visionOS) || os(tvOS)
4444
func makeUIView(context: Context) -> Self.ViewType {
4545
makeView(context: context)
4646
}

Sources/LiveKit/Support/TextView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import AppKit
2323
#endif
2424

2525
class TextView: NativeView {
26-
#if os(iOS) || os(visionOS)
26+
#if os(iOS) || os(visionOS) || os(tvOS)
2727
private class DebugUILabel: UILabel {
2828
override func drawText(in _: CGRect) {
2929
let textRect = super.textRect(forBounds: bounds, limitedToNumberOfLines: numberOfLines)
@@ -38,14 +38,14 @@ class TextView: NativeView {
3838

3939
var text: String? {
4040
get {
41-
#if os(iOS) || os(visionOS)
41+
#if os(iOS) || os(visionOS) || os(tvOS)
4242
_textView.text
4343
#elseif os(macOS)
4444
_textView.stringValue
4545
#endif
4646
}
4747
set {
48-
#if os(iOS) || os(visionOS)
48+
#if os(iOS) || os(visionOS) || os(tvOS)
4949
_textView.text = newValue
5050
#elseif os(macOS)
5151
_textView.stringValue = newValue ?? ""
@@ -54,7 +54,7 @@ class TextView: NativeView {
5454
}
5555

5656
override init(frame: CGRect) {
57-
#if os(iOS) || os(visionOS)
57+
#if os(iOS) || os(visionOS) || os(tvOS)
5858
_textView = DebugUILabel(frame: .zero)
5959
_textView.numberOfLines = 0
6060
_textView.adjustsFontSizeToFitWidth = false

Sources/LiveKit/Support/Utils.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Utils {
5656

5757
/// Returns current OS.
5858
static func os() -> OS {
59-
#if os(iOS) || os(visionOS)
59+
#if os(iOS) || os(visionOS) || os(tvOS)
6060
.iOS
6161
#elseif os(macOS)
6262
.macOS
@@ -80,7 +80,7 @@ class Utils {
8080
/// Returns a model identifier.
8181
/// format: `MacBookPro18,3`, `iPhone13,3` or `iOSSimulator,arm64`
8282
static func modelIdentifier() -> String? {
83-
#if os(iOS) || os(visionOS)
83+
#if os(iOS) || os(visionOS) || os(tvOS)
8484
var systemInfo = utsname()
8585
uname(&systemInfo)
8686
let machineMirror = Mirror(reflecting: systemInfo.machine)

Sources/LiveKit/Views/SampleBufferVideoRenderer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class SampleBufferVideoRenderer: NativeView, Loggable {
3838
// this is required for macOS
3939
wantsLayer = true
4040
layer?.insertSublayer(sampleBufferDisplayLayer, at: 0)
41-
#elseif os(iOS) || os(visionOS)
41+
#elseif os(iOS) || os(visionOS) || os(tvOS)
4242
layer.insertSublayer(sampleBufferDisplayLayer, at: 0)
4343
#else
4444
fatalError("Unimplemented")

0 commit comments

Comments
 (0)