Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android-Cam #1950

Closed
ixelizm opened this issue Oct 13, 2023 · 5 comments
Closed

Android-Cam #1950

ixelizm opened this issue Oct 13, 2023 · 5 comments

Comments

@ixelizm
Copy link

ixelizm commented Oct 13, 2023

Is it possible to open the camera of my Android device from the web page? In other words, it will ask for permission to use the camera and my device's camera will be turned on. I can do that?

@ixelizm
Copy link
Author

ixelizm commented Oct 13, 2023

Not PC camera i want to phone camera. like omegle

@frankhuurman
Copy link

Camera is still on the roadmap: https://flet.dev/roadmap/#september-2023---january-2024
And I can't find any Camera documentation in the framework so I assume there's no working camera element yet.

@Python-Zhao
Copy link

How is kivy implemented?

@Python-Zhao
Copy link

This example demonstrates a simple use of the camera. It shows a window with
a buttoned labelled 'play' to turn the camera on and off. Note that
not finding a camera, perhaps because gstreamer is not installed, will
throw an exception during the kv language processing.

'''

Uncomment these lines to see all the messages

from kivy.logger import Logger

import logging

Logger.setLevel(logging.TRACE)

from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
import time
Builder.load_string('''
:
orientation: 'vertical'
Camera:
id: camera
resolution: (640, 480)
play: False
ToggleButton:
text: 'Play'
on_press: camera.play = not camera.play
size_hint_y: None
height: '48dp'
Button:
text: 'Capture'
size_hint_y: None
height: '48dp'
on_press: root.capture()
''')

class CameraClick(BoxLayout):
def capture(self):
'''
Function to capture the images and give them the names
according to their captured time and date.
'''
camera = self.ids['camera']
timestr = time.strftime("%Y%m%d_%H%M%S")
camera.export_to_png("IMG_{}.png".format(timestr))
print("Captured")

class TestCamera(App):

def build(self):
    return CameraClick()

TestCamera().run()

@ndonkoHenri
Copy link
Collaborator

Closing as dup of #1281

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants