• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Camera App (made with html, css, java) not having acces to camera.

Scheduled Pinned Locked Moved App Development
15 Posts 6 Posters 1.2k Views 1 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      AppLee @ComLarsic
      last edited by 3 Jan 2020, 17:07

      @ComLarsic Hum what exactly is your behaviour ?

      I had a quick look at the github repository and maybe it has something to do with Morph Browser.
      I don't think Morph can access the camera, it's not working with websites like jitsi.org...

      C 1 Reply Last reply 4 Jan 2020, 07:20 Reply Quote 0
      • P Offline
        poVoq
        last edited by 3 Jan 2020, 18:08

        I think the underlaying qtwebengine should be able to do it, even in the relatively old version currently used in UT.

        Maybe just a question of triggering the permission request correctly?

        Fairphone 5 (waiting for port)

        1 Reply Last reply Reply Quote 0
        • H Offline
          hummlbach
          last edited by 3 Jan 2020, 19:20

          Just in case... common pitfall: version number has to be bumped after apparmor file has been changed in order to become effective.

          C 1 Reply Last reply 4 Jan 2020, 07:17 Reply Quote 0
          • J Offline
            jittopjose
            last edited by 4 Jan 2020, 01:51

            @ComLarsic I would like to know how did you build the clickable app. Is it done like, clickable create and select html option. Then copy all your html and javascript code to www folder to build ?

            I am also doing some experiments with a react app to build as click by packaging all the js and html file. Just like an offline html app.

            C 1 Reply Last reply 4 Jan 2020, 07:13 Reply Quote 0
            • C Offline
              ComLarsic @jittopjose
              last edited by 4 Jan 2020, 07:13

              @jittopjose yep, exactely like that. just make sure the .desktop file points to the correct .html/.htm file

              1 Reply Last reply Reply Quote 0
              • C Offline
                ComLarsic @hummlbach
                last edited by 4 Jan 2020, 07:17

                @hummlbach ah, did not know that :/. i'll try that when i have the time

                1 Reply Last reply Reply Quote 0
                • C Offline
                  ComLarsic @AppLee
                  last edited by 4 Jan 2020, 07:20

                  @AppLee i open the app, and an javasvript alert pops up that there is no camera available.

                  when i look at the webrct log it sgates that there is no webcam available

                  A 1 Reply Last reply 4 Jan 2020, 11:45 Reply Quote 0
                  • A Offline
                    AppLee @ComLarsic
                    last edited by 4 Jan 2020, 11:45

                    @ComLarsic
                    Yep that is how the app try to reach the camera, there are two things that I can think of right now.
                    First one is to adapt the code to qtWebengine because it seems to be browser oriented, basically that means rewriting the app because its core has to be adapted.
                    Another option I see is that the way UT protects access to the devices prevent from accessing it this way.

                    If I had to guess I'll opt for the second option and it could lead to "impossible with webapp" or to "you have to dive into the system to allow the device".

                    Depending on your coding ability I'll suggest to create a QML/C++ app using the provided API to access the camera :
                    https://api-docs.ubports.com/sdk/apps/qml/QtMultimedia/Camera.html

                    I don't have webdev skills too many abstraction layers for me brain to handle 😉

                    @jittopjose : You can have a look to this project :
                    https://gitlab.com/AppsLee/cardwallet

                    I just revived the project by creating a project with clickable. And I put the code from the original app into the www/ folder.
                    The code is simple enough for a template project so I hope it can help you.
                    And don't forget the apparmor and to bump the version number so it's well considered when testing.

                    C 1 Reply Last reply 4 Jan 2020, 14:17 Reply Quote 0
                    • C Offline
                      ComLarsic @AppLee
                      last edited by 4 Jan 2020, 14:17

                      @AppLee alright, thanks for the advise!
                      since i dont know C++ i will look into pyotherside for QML/Python.

                      1 Reply Last reply Reply Quote 0
                      • P Offline
                        poVoq
                        last edited by 4 Jan 2020, 14:29

                        There is a somewhat outdated Cordova implementation for UT. I guess that could also be a good place for investigating if there is a way to access the camera from an HTML app.

                        I would be surprised if that is not possible somehow, as back in the day Canonical was promoting webapps with UT quite hard.

                        Fairphone 5 (waiting for port)

                        A 1 Reply Last reply 4 Jan 2020, 14:39 Reply Quote 0
                        • A Offline
                          AppLee @poVoq
                          last edited by 4 Jan 2020, 14:39

                          @poVoq Back in the day they didn't have Morph Browser and lots of things have changed.

                          But you're right it's worth investigating. Good luck

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            dobey
                            last edited by 4 Jan 2020, 17:56

                            It is currently not possible to use camera from browser, because QtWebEngine isn't using QtMultimedia for camera yet.

                            1 Reply Last reply Reply Quote 1
                            13 out of 15
                            • First post
                              13/15
                              Last post