This application demonstrates a basic video conferencing setup using macOS platform APIs for detecting, previewing, and recording video and audio. It allows you to:
- List and select available webcams.
- Preview live video with an optional black & white filter.
- Display device connection status.
- Record video and audio to separate files.
- macOS 15+
- Xcode 14+ with Swift 5
- A system with at least one integrated or external webcam
- Optional external microphone for audio recording
- Copy the AirlabPlaywingTestTask.app file to your local machine and run it.
- Clone or download the repository to your local machine.
- Open the project in Xcode by double-clicking the
.xcodeprojor.xcworkspacefile. - Check signing settings if needed (in the project's Signing & Capabilities section).
- Build and run:
- Press the Run (▶) button in Xcode.
- The application window will open, displaying device dropdown menus and status indicators.
Application controls are located on the horizontal bar at the top of the screen.
-
Start/Stop (▶/⏹) Button
Controls the live feed of the selected camera. You can also start the video feed by pressing the big blue camera icon in the center of the screen. Once the video stream starts, it is displayed in the application window. You can change the camera and toggle the black-and-white mode while the video feed is running. -
Black/White Switch
Enables the black & white filter. -
Save Switch
Enables video recording to a file. If turned on, you can choose the output file name and location before starting the video feed. -
Refresh Button
Refreshes the list of available video cameras. -
Selected Camera Dropdown
Lets you pick the current camera from the list. Selected camera saves in application evironment between sessions.
- Device Integration: We used
AVFoundationto enumerate all video input devices and manage their connection states. A primary challenge was handling permissions and ensuring that changes in device selection were dynamically reflected in the preview. - Video Preview: Live video is captured using an
AVCaptureSession, with a grayscale filter applied by intercepting the video buffer. Efficient data handling and GPU usage were key to maintaining performance. - User Interface: A straightforward layout with dropdowns and buttons offers clarity. We synchronized the UI with camera status updates by observing relevant
AVCaptureSessionnotifications. - Bonus (Recording): For separate video files, we used distinct
AVCaptureMovieFileOutputconnections. Handling file paths and ensuring correct formatting presented a small challenge when managing simultaneous recording streams.
If you have any questions about setup or usage, please let me know!