From 23d6290672b823a352b1c34bc41d6d99eeb91ea2 Mon Sep 17 00:00:00 2001 From: Filipi Fuchter Date: Wed, 8 Jan 2025 12:05:04 -0300 Subject: [PATCH] Removing not used class. --- .../views/components/DailyVideoView.swift | 69 ------------------- 1 file changed, 69 deletions(-) delete mode 100644 examples/simple-chatbot/examples/ios/SimpleChatbot/views/components/DailyVideoView.swift diff --git a/examples/simple-chatbot/examples/ios/SimpleChatbot/views/components/DailyVideoView.swift b/examples/simple-chatbot/examples/ios/SimpleChatbot/views/components/DailyVideoView.swift deleted file mode 100644 index 64bfe0eca..000000000 --- a/examples/simple-chatbot/examples/ios/SimpleChatbot/views/components/DailyVideoView.swift +++ /dev/null @@ -1,69 +0,0 @@ -import SwiftUI - -import Daily -import RTVIClientIOS -import RTVIClientIOSDaily - - -/// A wrapper for `VoiceClientVideoView` that exposes the video size via a `@Binding`. -struct DailyVideoView: UIViewRepresentable { - - /// The current size of the video being rendered by this view. - @Binding private(set) var videoSize: CGSize - - private let voiceClientTrack: MediaTrackId? - private let videoScaleMode: VoiceClientVideoView.VideoScaleMode - - init( - voiceClientTrack: MediaTrackId? = nil, - videoScaleMode: VoiceClientVideoView.VideoScaleMode = .fill, - videoSize: Binding = .constant(.zero) - ) { - self.voiceClientTrack = voiceClientTrack - self.videoScaleMode = videoScaleMode - self._videoSize = videoSize - } - - func makeUIView(context: Context) -> VoiceClientVideoView { - let videoView = VoiceClientVideoView() - videoView.delegate = context.coordinator - return videoView - } - - func updateUIView(_ videoView: VoiceClientVideoView, context: Context) { - context.coordinator.dailyVideoView = self - - if videoView.voiceClientTrack != voiceClientTrack { - videoView.voiceClientTrack = voiceClientTrack - } - - if videoView.videoScaleMode != videoScaleMode { - videoView.videoScaleMode = videoScaleMode - } - } -} - -extension DailyVideoView { - final class Coordinator: VideoViewDelegate { - fileprivate var dailyVideoView: DailyVideoView - - init(_ dailyVideoView: DailyVideoView) { - self.dailyVideoView = dailyVideoView - } - - func videoView(_ videoView: Daily.VideoView, didChangeVideoSize size: CGSize) { - // Update the `videoSize` binding with the current `size` value. - DispatchQueue.main.async { - self.dailyVideoView.videoSize = size - } - } - } - - func makeCoordinator() -> Coordinator { - Coordinator(self) - } -} - -#Preview { - VideoView() -}