Skip to content

Instantly share code, notes, and snippets.

@amosgyamfi
Created September 26, 2023 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amosgyamfi/8b626c3d39983c0f2f7b2d11df25990d to your computer and use it in GitHub Desktop.
Save amosgyamfi/8b626c3d39983c0f2f7b2d11df25990d to your computer and use it in GitHub Desktop.
//
// FloatingParticipantView.swift
// VideoConferencingSwiftUI
//
// Created by amos.gyamfi@getstream.io on 18.9.2023.
//
import Foundation
import SwiftUI
import StreamVideo
import StreamVideoSwiftUI
struct FloatingParticipantView: View {
var participant: CallParticipant?
var size: CGSize = .init(width: 140, height: 180)
var body: some View {
if let participant = participant {
VStack {
HStack {
Spacer()
VideoRendererView(id: participant.id, size: size) { videoRenderer in
videoRenderer.handleViewRendering(for: participant, onTrackSizeUpdate: { _, _ in })
}
.clipShape(RoundedRectangle(cornerRadius: 24))
.frame(width: size.width, height: size.height)
}
Spacer()
}
.padding()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment