Skip to content

Commit 7dd9a43

Browse files
authored
Smooth transition for VideoView capture position update (#383)
When capture position update is detected: 1. Creates a secondary renderer view in the back of primary renderer 2. Renders some frames (2 frames) on secondary renderer 3. Executes animated primary secondary renderer swap 4. Sets rendering back to primary renderer - [x] Ensure clean up - [x] Add animation preference properties <table> <thead> <tr> <th align="center">Before this PR</th> <th align="center">CrossDissolve</th> <th align="center">Flip</th> </tr> </thead> <tbody> <tr> <td align="left"><video src="https://github.com/livekit/client-sdk-swift/assets/548776/fc2a95c1-c77a-4e67-a798-97e77867f8d7" controls="controls" style="max-width: 730px;"></video></td> <td align="center"><video src="https://github.com/livekit/client-sdk-swift/assets/548776/4c025cbe-028c-46f3-9154-8349e3c35224" controls="controls" style="max-width: 730px;"></video></td> <td align="right"><video src="https://github.com/livekit/client-sdk-swift/assets/548776/20914b2e-ffa2-4420-8307-2a33b61d463f" controls="controls" style="max-width: 730px;"></video></td> </tr> </tbody> </table>
1 parent 60cb24c commit 7dd9a43

File tree

2 files changed

+196
-50
lines changed

2 files changed

+196
-50
lines changed

Sources/LiveKit/Support/NativeView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ open class NativeView: NativeViewType {
6464
public func bringSubviewToFront(_ view: NSView) {
6565
addSubview(view)
6666
}
67+
68+
public func insertSubview(_ view: NSView, belowSubview: NSView) {
69+
addSubview(view, positioned: .below, relativeTo: belowSubview)
70+
}
6771
#endif
6872

6973
open func performLayout() {

0 commit comments

Comments
 (0)