import Flutter
import linphonesw

class RemoteView: NSObject, FlutterPlatformView {
    private var _lvvh: LinphoneVideoViewHolder? = nil
    private var _view: UIView? = nil

    init(
        frame: CGRect,
        viewIdentifier viewId: Int64,
        arguments args: Any?,
        binaryMessenger messenger: FlutterBinaryMessenger?,
        cacher: (UIView) -> Void
    ) {
        super.init()
        
        _lvvh = LinphoneVideoViewHolder { view in
            self._view = view
        }
        
        cacher(_view!)
    }

    func view() -> UIView {
        return _view!
    }
}
