beeware / toga

A Python native, OS native GUI toolkit.
https://toga.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
4.19k stars 656 forks source link

Add video support to the Camera API #2575

Open cdgriffith opened 1 month ago

cdgriffith commented 1 month ago

What is the problem or limitation you are having?

The camera API lists it can take video currently, but there do not seem to be any methods for it. https://toga.readthedocs.io/en/stable/reference/api/hardware/camera.html

Describe the solution you'd like

Be able to take and save a video on Andriod and iOS

Describe alternatives you've considered

N/A

Additional context

No response

freakboy3742 commented 1 month ago

Thanks for the report. The reference to video in the description is an oversight; as currently implemented, the camera API can't be used to capture video. For right now, the documentation should be definitely be corrected to remove the video reference.

Capturing video shouldn't be that difficult - as far as I'm aware, a slightly different call on the same APIs that are already in use will allow capture of video; the only additional step is that microphone permissions might be required on some platforms.

However, the bigger issue is that once you've got a captured video, we don't currently have a cross-platform Toga representation to store that video. Before we can realistically add video support to the camera, we really need to add a toga.Video class to store video, and a toga.VideoView widget to display videos - analogs of the toga.Image and toga.ImageView widgets used for images.