Skip to content

Commit da5957b

Browse files
pblazejclaude
andauthored
Workaround for video view orientation freeze (#954)
Resolves #949 This is just a workaround - there are some possible improvements on WebRTC side (avoid unbounded waits etc.), but we're unable to isolate the root cause for now. IMO that's a good tradeoff for older devices (approaching end of support). --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dc1f871 commit da5957b

4 files changed

Lines changed: 20 additions & 5 deletions

File tree

.changes/metal-renderer-fallback

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
patch type="fixed" "Avoid Metal pipeline freeze on iPhone 11 family by defaulting to sample buffer renderer"

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ jobs:
5757
# https://github.com/actions/runner-images/blob/main/images/macos/macos-26-arm64-Readme.md
5858
- os: macos-26
5959
xcode: 26.4
60-
platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.4"
60+
platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.4.1"
6161
symbol-graph: true
6262
- os: macos-26
6363
xcode: 26.4
64-
platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.4"
64+
platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.4.1"
6565
extension-api-only: true
6666
- os: macos-26
6767
xcode: 26.4
@@ -84,7 +84,7 @@ jobs:
8484
platform: "macOS,variant=Mac Catalyst"
8585
- os: macos-26
8686
xcode: 26.4
87-
platform: "visionOS Simulator,name=Apple Vision Pro,OS=26.4"
87+
platform: "visionOS Simulator,name=Apple Vision Pro,OS=26.4.1"
8888
- os: macos-26
8989
xcode: 26.4
9090
platform: "tvOS Simulator,name=Apple TV,OS=26.4"

.github/workflows/publish-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
matrix:
2525
include:
26-
- platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.4"
26+
- platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.4.1"
2727
artifact_name: symbol-graph-ios
2828
- platform: "macOS"
2929
artifact_name: symbol-graph-macos

Sources/LiveKit/Views/VideoView.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,9 +773,23 @@ extension VideoView {
773773
#endif
774774
}
775775

776+
/// `true` when no Metal device exists or the GPU is Apple family ≤ 6
777+
/// (pre-A14 / M1), where the WebRTC Metal path is unstable under rotation.
778+
static let shouldAvoidMetalRenderer: Bool = {
779+
guard let device = MTLCreateSystemDefaultDevice() else { return true }
780+
return !device.supportsFamily(.apple7)
781+
}()
782+
776783
static func createNativeRendererView(for renderMode: VideoView.RenderMode) -> NativeRendererView {
777784
#if os(iOS) || os(macOS)
778-
if case .sampleBuffer = renderMode {
785+
let resolvedRenderMode: VideoView.RenderMode = {
786+
if case .auto = renderMode {
787+
return shouldAvoidMetalRenderer ? .sampleBuffer : .metal
788+
}
789+
return renderMode
790+
}()
791+
792+
if case .sampleBuffer = resolvedRenderMode {
779793
log("Using AVSampleBufferDisplayLayer for VideoView's Renderer")
780794
return SampleBufferVideoRenderer()
781795
} else {

0 commit comments

Comments
 (0)